casdoor-js-sdk
Advanced tools
Comparing version 0.14.0 to 0.15.0
@@ -167,3 +167,4 @@ import ITokenResponse from "js-pkce/dist/ITokenResponse"; | ||
}; | ||
refreshAccessToken(refreshToken: string): Promise<ITokenResponse>; | ||
} | ||
export default Sdk; |
@@ -183,3 +183,6 @@ "use strict"; | ||
} | ||
refreshAccessToken(refreshToken) { | ||
return this.pkce.refreshAccessToken(refreshToken); | ||
} | ||
} | ||
exports.default = Sdk; |
@@ -167,3 +167,4 @@ import ITokenResponse from "js-pkce/dist/ITokenResponse"; | ||
}; | ||
refreshAccessToken(refreshToken: string): Promise<ITokenResponse>; | ||
} | ||
export default Sdk; |
@@ -181,3 +181,6 @@ // Copyright 2021 The Casdoor Authors. All Rights Reserved. | ||
} | ||
refreshAccessToken(refreshToken) { | ||
return this.pkce.refreshAccessToken(refreshToken); | ||
} | ||
} | ||
export default Sdk; |
{ | ||
"name": "casdoor-js-sdk", | ||
"version": "0.14.0", | ||
"version": "0.15.0", | ||
"description": "Javascript client SDK for Casdoor", | ||
@@ -5,0 +5,0 @@ "main": "lib/cjs/index.js", |
@@ -221,2 +221,13 @@ # casdoor-js-sdk | ||
#### Refresh access token | ||
You could use a refresh token, to get a new token from the oauth server when token expired. | ||
```typescript | ||
sdk.refreshAccessToken(refreshToken).then((resp) => { | ||
const token = resp.access_token; | ||
// Do stuff with new access token | ||
}); | ||
``` | ||
#### A note on Storage | ||
@@ -223,0 +234,0 @@ By default, this package will use sessionStorage to persist the pkce_state. On (mostly) mobile devices there's a higher chance users are returning in a different browser tab. E.g. they kick off in a WebView & get redirected to a new tab. The sessionStorage will be empty there. |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
47732
746
259