mirror of
https://github.com/toeverything/AFFiNE.git
synced 2026-07-13 08:06:24 +08:00
@@ -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' },
|
||||
|
||||
@@ -131,6 +131,12 @@ export class InvalidOauthCallbackCode extends UserFriendlyError {
|
||||
super('bad_request', 'invalid_oauth_callback_code', message, args);
|
||||
}
|
||||
}
|
||||
|
||||
export class InvalidAuthState extends UserFriendlyError {
|
||||
constructor(message?: string) {
|
||||
super('bad_request', 'invalid_auth_state', message);
|
||||
}
|
||||
}
|
||||
@ObjectType()
|
||||
class MissingOauthQueryParameterDataType {
|
||||
@Field() name!: string
|
||||
@@ -895,6 +901,7 @@ export enum ErrorNames {
|
||||
OAUTH_STATE_EXPIRED,
|
||||
INVALID_OAUTH_CALLBACK_STATE,
|
||||
INVALID_OAUTH_CALLBACK_CODE,
|
||||
INVALID_AUTH_STATE,
|
||||
MISSING_OAUTH_QUERY_PARAMETER,
|
||||
OAUTH_ACCOUNT_ALREADY_CONNECTED,
|
||||
INVALID_EMAIL,
|
||||
|
||||
Reference in New Issue
Block a user