feat(auth-google,auth-github): Allow passing a custom callbackUrl to … (#10829)

* feat(auth-google,auth-github): Allow passing a custom callbackUrl to oauth providers

* feat: Add state management in auth providers

* chore: Changes based on PR review
This commit is contained in:
Stevche Radevski
2025-01-06 17:33:29 +01:00
committed by GitHub
parent 9490c265b2
commit fde73dbfae
8 changed files with 289 additions and 68 deletions
+1 -1
View File
@@ -92,7 +92,7 @@ export const ModulesDefinition: {
label: upperCaseFirst(Modules.AUTH),
isRequired: false,
isQueryable: true,
dependencies: [ContainerRegistrationKeys.LOGGER],
dependencies: [ContainerRegistrationKeys.LOGGER, Modules.CACHE],
defaultModuleDeclaration: {
scope: MODULE_SCOPE.INTERNAL,
},
@@ -59,6 +59,10 @@ export type AuthenticationInput = {
/**
* Body of the incoming authentication request.
*
* One of the arguments that is suggested to be treated in a standard manner is a `callback_url` field.
* The field specifies where the user is redirected to after a successful authentication in the case of Oauth auhentication.
* If not passed, the provider will fallback to the callback_url provided in the provider options.
*/
body?: Record<string, string>
+3
View File
@@ -20,6 +20,9 @@ export interface AuthIdentityProviderService {
user_metadata?: Record<string, unknown>
}
) => Promise<AuthIdentityDTO>
// These methods are used for OAuth providers to store and retrieve state
setState: (key: string, value: Record<string, unknown>) => Promise<void>
getState: (key: string) => Promise<Record<string, unknown> | null>
}
/**