Skip to content

Commit

Permalink
up
Browse files Browse the repository at this point in the history
  • Loading branch information
atinux committed Feb 19, 2025
1 parent c3f1ae3 commit 5a19972
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/runtime/server/lib/oauth/okta.ts
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export function defineOAuthOktaEventHandler({ config, onSuccess, onError }: OAut
}) as OAuthOktaConfig

if (!config.clientId || !config.clientSecret || !config.domain) {
return handleMissingConfiguration(event, 'auth0', ['clientId', 'clientSecret', 'domain'], onError)
return handleMissingConfiguration(event, 'okta', ['clientId', 'clientSecret', 'domain'], onError)
}
const authorizationURL = `https://${config.domain}.okta.com/oauth2/v1/authorize`
const tokenURL = `https://${config.domain}.okta.com/oauth2/v1/token`
Expand Down Expand Up @@ -90,12 +90,11 @@ export function defineOAuthOktaEventHandler({ config, onSuccess, onError }: OAut
}

const accessToken = tokens.access_token
// TODO: improve typing
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const emails: any[] = await $fetch(`https://${config.domain}.okta.com/idp/myaccount/emails`, {
headers: {
'Accept': 'application/json; okta-version=1.0.0',
'Authorization': `Bearer ${accessToken}`,
Accept: 'application/json; okta-version=1.0.0',
Authorization: `Bearer ${accessToken}`,
},
})

Expand Down

0 comments on commit 5a19972

Please sign in to comment.