Build(deps): bump @auth0/auth0-spa-js from 1.22.5 to 2.0.0

Bumps [@auth0/auth0-spa-js](https://github.com/auth0/auth0-spa-js) from 1.22.5 to 2.0.0.
- [Release notes](https://github.com/auth0/auth0-spa-js/releases)
- [Changelog](https://github.com/auth0/auth0-spa-js/blob/master/CHANGELOG.md)
- [Commits](https://github.com/auth0/auth0-spa-js/compare/v1.22.5...v2.0.0)
This commit is contained in:
2022-10-29 04:38:04 +00:00
parent 441484651d
commit e788a9fc3a
4 changed files with 19 additions and 50 deletions
+10 -8
View File
@@ -1,6 +1,6 @@
import createAuth0Client, {
import {
createAuth0Client,
Auth0Client,
GetIdTokenClaimsOptions,
GetTokenSilentlyOptions,
IdToken,
LogoutOptions,
@@ -21,7 +21,7 @@ interface Client {
error: Ref
handleRedirectCallback: () => Promise<void>
loginWithRedirect: (o: RedirectLoginOptions) => Promise<void>
getIdTokenClaims: (o: GetIdTokenClaimsOptions) => Promise<void | IdToken | undefined>
getIdTokenClaims: () => Promise<void | IdToken | undefined>
getTokenSilently: (o: GetTokenSilentlyOptions) => Promise<string | void>
logout: (o: LogoutOptions) => Promise<void>
}
@@ -37,9 +37,11 @@ export const useAuth = (onRedirectCallback: (appState?: any) => void = DEFAULT_R
}
const options = {
domain,
client_id: 'orQfnvCPUR5C3mJkKoiWLQHOVQsBn60e',
audience: 'http://dancefinder.unbound.se',
redirect_uri: window.location.origin
clientId: 'orQfnvCPUR5C3mJkKoiWLQHOVQsBn60e',
authorizationParams: {
audience: 'http://dancefinder.unbound.se',
redirect_uri: window.location.origin
}
}
instance = {
@@ -76,8 +78,8 @@ export const useAuth = (onRedirectCallback: (appState?: any) => void = DEFAULT_R
})
},
/** Returns all the claims present in the ID token */
getIdTokenClaims: (o: GetIdTokenClaimsOptions) => {
return instance.auth0Client!.then(client => client.getIdTokenClaims(o))
getIdTokenClaims: () => {
return instance.auth0Client!.then(client => client.getIdTokenClaims())
},
/** Returns the access token. If the token is invalid or missing, a new one is retrieved */
getTokenSilently: (o: GetTokenSilentlyOptions) => {