@logto/client
Advanced tools
Comparing version 2.6.5 to 2.6.6
@@ -74,2 +74,6 @@ import { type IdTokenClaims, type UserInfoResponse, type AccessTokenClaims, type OidcConfigResponse, type SignInUriParameters } from '@logto/js'; | ||
/** | ||
* Clear all cached tokens from storage. | ||
*/ | ||
readonly clearAllTokens: (this: unknown) => Promise<void>; | ||
/** | ||
* Handle the sign-in callback by parsing the authorization code from the | ||
@@ -76,0 +80,0 @@ * callback URI and exchanging it for the tokens. |
@@ -63,2 +63,6 @@ import { decodeIdToken, decodeAccessToken, fetchUserInfo, generateSignInUri, revoke, generateSignOutUri, fetchTokenByRefreshToken, fetchOidcConfig, UserScope, verifyAndParseCodeFromCallbackUri, fetchTokenByAuthorizationCode } from '@logto/js'; | ||
/** | ||
* Clear all cached tokens from storage. | ||
*/ | ||
this.clearAllTokens = memoize(this.#clearAllTokens); | ||
/** | ||
* Handle the sign-in callback by parsing the authorization code from the | ||
@@ -185,5 +189,3 @@ * callback URI and exchanging it for the tokens. | ||
this.setSignInSession({ redirectUri, postRedirectUri, codeVerifier, state }), | ||
this.setRefreshToken(null), | ||
this.setIdToken(null), | ||
this.clearAccessToken(), | ||
this.clearAllTokens(), | ||
]); | ||
@@ -236,3 +238,3 @@ await this.adapter.navigate(signInUri, { redirectUri, for: 'sign-in' }); | ||
}); | ||
await Promise.all([this.setRefreshToken(null), this.setIdToken(null), this.clearAccessToken()]); | ||
await this.clearAllTokens(); | ||
await this.adapter.navigate(url, { redirectUri: postLogoutRedirectUri, for: 'sign-out' }); | ||
@@ -355,2 +357,5 @@ } | ||
} | ||
async #clearAllTokens() { | ||
await Promise.all([this.setRefreshToken(null), this.setIdToken(null), this.clearAccessToken()]); | ||
} | ||
async #handleSignInCallback(callbackUri) { | ||
@@ -357,0 +362,0 @@ const signInSession = await this.getSignInSession(); |
{ | ||
"name": "@logto/client", | ||
"version": "2.6.5", | ||
"version": "2.6.6", | ||
"type": "module", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.cjs", |
Sorry, the diff of this file is not supported yet
88999
2000