Skip to content

Commit

Permalink
Merge branch 'main' into gitea
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux authored Feb 4, 2025
2 parents 2d478c2 + 6c5c4cd commit ba4afab
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/autofix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ jobs:

steps:
- uses: actions/checkout@v4
- run: corepack enable
- run: npm i -g --force corepack && corepack enable
- uses: actions/setup-node@v4
with:
node-version: 20
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: corepack enable
- run: npm i -g --force corepack && corepack enable
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: 20
Expand All @@ -50,7 +50,7 @@ jobs:

steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- run: corepack enable
- run: npm i -g --force corepack && corepack enable
- uses: actions/setup-node@8f152de45cc393bb48ce5d89d36b731f54556e65 # v4.0.0
with:
node-version: 20
Expand Down
1 change: 1 addition & 0 deletions src/runtime/server/lib/oauth/github.ts
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ export function defineOAuthGitHubEventHandler({ config, onSuccess, onError }: OA
return onError(event, error)
}
user.email = primaryEmail.email
user.email_verified = primaryEmail.verified
}

return onSuccess(event, {
Expand Down
6 changes: 4 additions & 2 deletions src/runtime/server/lib/oauth/microsoft.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,17 @@ export function defineOAuthMicrosoftEventHandler({ config, onSuccess, onError }:
const redirectURL = config.redirectURL || getOAuthRedirectURL(event)

if (!query.code) {
const scope = config.scope && config.scope.length > 0 ? config.scope : ['User.Read']
config.scope = config.scope && config.scope.length > 0 ? config.scope : ['User.Read']
// guarantee uniqueness of the scope
config.scope = [...new Set(config.scope)]
// Redirect to Microsoft Oauth page
return sendRedirect(
event,
withQuery(authorizationURL as string, {
client_id: config.clientId,
response_type: 'code',
redirect_uri: redirectURL,
scope: scope.join(' '),
scope: config.scope.join(' '),
...config.authorizationParams,
}),
)
Expand Down

0 comments on commit ba4afab

Please sign in to comment.