also looking at this
Deploy: uniform auth session model (main → production)
#7
282 files
+3028
-64856
Review threads live on the whole diff, not on one commit, so none are shown here - a thread's line means something in the branch's final form, and painting it into an intermediate step would put it on code it is not about.
| @@ -38,11 +38,11 @@ export default new Action({ | ||
| 38 | 38 | // wrong) must start over from LoginAction, not retry. |
| 39 | 39 | const userId = await consumeTwoFactorChallenge(challengeToken) |
| 40 | 40 | if (!userId) |
| 41 | return response.unauthorized('This login attempt has expired — please sign in again.') | |
| 41 | return response.unauthorized('This login attempt has expired - please sign in again.') | |
| 42 | 42 | |
| 43 | 43 | const valid = await verifyTwoFactorLoginCode(userId, code) |
| 44 | 44 | if (!valid) |
| 45 | return response.unauthorized('Invalid code — please sign in again.') | |
| 45 | return response.unauthorized('Invalid code - please sign in again.') | |
| 46 | 46 | |
| 47 | 47 | // Carry the "remember me" tier chosen on step one through to the session |
| 48 | 48 | // issued here, so a 2FA account is not silently downgraded to the baseline |
| @@ -50,7 +50,7 @@ export default new Action({ | ||
| 50 | 50 | const expiresInMinutes = sessionExpiryMinutes(request.get('remember')) |
| 51 | 51 | const result = await Auth.loginUsingId(userId, { expiresInMinutes }) |
| 52 | 52 | if (!result) |
| 53 | return response.unauthorized('Invalid code — please sign in again.') | |
| 53 | return response.unauthorized('Invalid code - please sign in again.') | |
| 54 | 54 | |
| 55 | 55 | const user = result.user |
| 56 | 56 | |
| @@ -109,7 +109,7 @@ async function onVerify(e: Event): Promise<void> { | ||
| 109 | 109 | return |
| 110 | 110 | } |
| 111 | 111 | // Challenge tokens are single-use; send a failed attempt back to step one. |
| 112 | error.set((r.data && (r.data.message || r.data.error)) || 'Invalid code — please sign in again.') | |
| 112 | error.set((r.data && (r.data.message || r.data.error)) || 'Invalid code - please sign in again.') | |
| 113 | 113 | code.set('') |
| 114 | 114 | mode.set('credentials') |
| 115 | 115 | } |