Skip to content
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

Add callbackUrl option to OAuth provider config #5375

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion packages/next-auth/src/core/lib/providers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,9 @@ export default function parseProviders(params: {
return merge(normalizedOptions, {
...normalizedUserOptions,
signinUrl: `${url}/signin/${id}`,
callbackUrl: `${url}/callback/${id}`,
callbackUrl:
normalizedUserOptions?.callbackUrl ??
`${url}/callback/${id}`,
})
}
const id = (userOptions?.id as string) ?? rest.id
Expand Down
1 change: 1 addition & 0 deletions packages/next-auth/src/providers/oauth.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,7 @@ export interface OAuthConfig<P> extends CommonProviderOptions, PartialIssuer {
jwks?: { keys: JWK[] }
clientId?: string
clientSecret?: string
callbackUrl?: string
/**
* If set to `true`, the user information will be extracted
* from the `id_token` claims, instead of
Expand Down