Skip to content

Commit 1c9a2e0

Browse files
docs(auth): GitHub OAuth scopes optional (#726)
* feat(auth): GitHub OAuth scopes optional * feat: revert and doc
1 parent 6615289 commit 1c9a2e0

File tree

2 files changed

+5
-5
lines changed

2 files changed

+5
-5
lines changed

packages/auth/src/providers/github/_openid.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@ export const requestGitHubJwtWithRedirect = ({
2020

2121
requestUrl.searchParams.set('redirect_uri', redirectUrl ?? currentUrl);
2222

23+
// Note: GitHub Apps ignore this parameter and use permissions from app settings instead
2324
requestUrl.searchParams.set('scope', authScopes.join(' '));
2425

2526
// Used for security reasons. When the provider redirects to the application,

packages/core/src/auth/types/github.ts

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
1-
export type AuthScope = 'openid' | 'profile' | 'email';
2-
31
/**
4-
* Combination of OAuth scopes supported by GitHub.
2+
* OAuth scopes supported by GitHub.
3+
* Only applicable for OAuth Apps - GitHub Apps use permissions configured in app settings.
54
*
65
* - `'read:user'` is always required.
76
* - `'user:email'` is optional.
@@ -33,8 +32,8 @@ export interface GitHubRedirectOptions {
3332

3433
/**
3534
* OAuth scopes to request.
36-
* Must begin with `'openid'` and include `'profile'`, `'email'`, or both.
37-
* @default ['openid', 'profile', 'email']
35+
* Optional - only used for OAuth Apps. GitHub Apps ignore this parameter.
36+
* @default ['read:user', 'user:email']
3837
*/
3938
authScopes?: GitHubAuthScopes;
4039

0 commit comments

Comments
 (0)