-
-
Notifications
You must be signed in to change notification settings - Fork 11.3k
Improved handling of TwoFactorAuthentication error #22856
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
WalkthroughThis pull request introduces a new function, Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 ESLint
ghost/admin/app/services/ajax.jsOops! Something went wrong! :( ESLint: 8.57.1 Error: Failed to load parser '@babel/eslint-parser' declared in 'ghost/admin/.eslintrc.js': Cannot find module '@babel/eslint-parser'
ghost/admin/tests/integration/services/ajax-test.jsOops! Something went wrong! :( ESLint: 8.57.1 Error: Failed to load parser '@babel/eslint-parser' declared in 'ghost/admin/.eslintrc.js': Cannot find module '@babel/eslint-parser'
📜 Recent review detailsConfiguration used: CodeRabbit UI 📥 CommitsReviewing files that changed from the base of the PR and between fe99b4e48533b879232e4a7baafdf806437cd4a2 and 9fcedee. 📒 Files selected for processing (3)
💤 Files with no reviewable changes (1)
🚧 Files skipped from review as they are similar to previous changes (1)
⏰ Context from checks skipped due to timeout of 90000ms (4)
🔇 Additional comments (4)
✨ Finishing Touches
🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
ref https://linear.app/ghost/issue/ENG-2074/adjust-verification-copy-if-2fa-is-enabled-for-all-logins ref https://linear.app/ghost/issue/ENG-2134/editor-reauthentication-flow-doesnt-work-how-i-expect-and-is-untested - Whilst working towards being able to do better differentiation of what 2fa flow we are in based on the error response from the server I came across the re-authentication unit test file - This file has 3 tests, 2 are essentially testing the same thing, and all 3 tests stub out too much and don't directly test any other code except the stubs - The first two tests are verifying the isTwoFactorAuthenticationError logic. In moving that to the ajax service integration tests, I found issues with the way the payload is handled - This change therefore also includes a fix to ensure the payload is always JSON that we can inspect - I've deleted the re-authentication tests because they don't actually test anything - I did attempt to replace the intention of testing the modal flow, with an integration or acceptance test, but I couldn't find any way to do this quickly - I've raised https://linear.app/ghost/issue/ENG-2134/editor-reauthentication-flow-doesnt-work-how-i-expect-and-is-untested to come back to later
ref https://linear.app/ghost/issue/ENG-2074/adjust-verification-copy-if-2fa-is-enabled-for-all-logins ref https://linear.app/ghost/issue/ENG-2134/editor-reauthentication-flow-doesnt-work-how-i-expect-and-is-untested