Skip to content

Commit ac6a891

Browse files
adinvadimatinux
andauthored
fix: Add configurable scope to Authentik provider (#446)
Co-authored-by: Sébastien Chopin <[email protected]> Co-authored-by: Sébastien Chopin <[email protected]>
1 parent 8fb1c4b commit ac6a891

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/runtime/server/lib/oauth/authentik.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,13 @@ export interface OAuthAuthentikConfig {
2727
* Redirect URL to allow overriding for situations like prod failing to determine public hostname
2828
* @default process.env.NUXT_OAUTH_AUTHENTIK_REDIRECT_URL or current URL
2929
*/
30-
redirectURL?: string
30+
redirectURL?: string,
31+
32+
/**
33+
* Authentik Scope
34+
* @default ['openid', 'profile', 'email']
35+
*/
36+
scope?: string[]
3137
}
3238

3339
export function defineOAuthAuthentikEventHandler({ config, onSuccess, onError }: OAuthConfig<OAuthAuthentikConfig>) {
@@ -63,7 +69,7 @@ export function defineOAuthAuthentikEventHandler({ config, onSuccess, onError }:
6369
response_type: 'code',
6470
client_id: config.clientId,
6571
redirect_uri: redirectURL,
66-
scope: ['openid', 'profile', 'email'].join(' '),
72+
scope: (config.scope || ['openid', 'profile', 'email']).join(' '),
6773
}),
6874
)
6975
}

0 commit comments

Comments
 (0)