Skip to content

Commit

Permalink
feat: add auth0 connection parameter to config (#39)
Browse files Browse the repository at this point in the history
* feat: add connection param for auth0

* fix: correct comment
  • Loading branch information
silvio-e authored Jan 29, 2024
1 parent e1f33fa commit 2ea2ba8
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/runtime/server/lib/oauth/auth0.ts
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,13 @@ export interface OAuthAuth0Config {
* @see https://auth0.com/docs/authenticate/login/max-age-reauthentication
*/
maxAge?: number
/**
* Login connection. If no connection is specified, it will redirect to the standard Auth0 login page and show the Login Widget.
* @default ''
* @see https://auth0.com/docs/api/authentication#social
* @example 'github'
*/
connection?: string
}

export function auth0EventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthAuth0Config>) {
Expand Down Expand Up @@ -80,6 +87,7 @@ export function auth0EventHandler({ config, onSuccess, onError }: OAuthConfig<OA
scope: config.scope.join(' '),
audience: config.audience || '',
max_age: config.maxAge || 0,
connection: config.connection || ''
})
)
}
Expand Down

0 comments on commit 2ea2ba8

Please sign in to comment.