You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// Keep the order if both are in the new flow or both are not
35
+
if(aIn===bIn)return0;
36
+
// Move the one that is in the new flow to the end
37
+
returnaIn ? 1 : -1;
38
+
};
39
+
21
40
/**
22
41
* Function that returns the ordered steps to try to perform the webauthn authentication.
23
42
*
@@ -27,7 +46,13 @@ type Parameters = {
27
46
*
28
47
* Logic:
29
48
* - To calculate the RP IDs, we look for all RP IDs within the devices
30
-
* - At the moment, we only use non-iframe if the RP ID matches the current origin. to avoid bad UX, if the RP ID doesn't match the current origin, the iframe will be used.
49
+
* - We sort the devices to move the devices registered on the new flow origins to the end
50
+
* - The rest of the order we keep as is because it's the order by last used (recently used first) returned by the backend
51
+
* We do this because during the upgrade flow a new passkey is created and it will be used to authenticate in 1.0. This was initially considered a feature, not a bug.
52
+
* But users don't know where passkeys are stored.
53
+
* Therefore, the passkey that they use to authenticate in 1.0 is not in the same place where they upgraded.
54
+
* Which triggers a new UX for the user that confuses them because they were used to a different UX.
55
+
* - We only use non-iframe if the RP ID matches the current origin. to avoid bad UX, if the RP ID doesn't match the current origin, the iframe will be used.
31
56
*
32
57
* @param {Parameters} params - The parameters to find the webauthn steps.
33
58
* @returns {WebAuthnFlow[]} The ordered steps to try to perform the webauthn authentication.
0 commit comments