refactor(server): improve oauth login flow (#10648)

close CLOUD-145
This commit is contained in:
fengmk2
2025-03-12 06:53:29 +00:00
parent d823792f85
commit 867ae7933f
16 changed files with 211 additions and 31 deletions

View File

@@ -55,6 +55,7 @@ const IncludedEvents = new Set([
'missing_oauth_query_parameter',
'unknown_oauth_provider',
'invalid_oauth_callback_state',
'invalid_oauth_state',
'oauth_state_expired',
'oauth_account_already_connected',
]);
@@ -319,6 +320,11 @@ export const USER_FRIENDLY_ERRORS = {
message: ({ status, body }) =>
`Invalid callback code parameter, provider response status: ${status} and body: ${body}.`,
},
invalid_auth_state: {
type: 'bad_request',
message:
'Invalid auth state. You might start the auth progress from another device.',
},
missing_oauth_query_parameter: {
type: 'bad_request',
args: { name: 'string' },