Skip to content

Commit

Permalink
feat: update to casdoor-js-sdk v0.10.0 and fix README (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
irvanmohamad authored May 25, 2023
1 parent 06e6807 commit 8f90c5e
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ const sdkConfig = {
appName: "application_hnpzib",
organizationName: "organization_4emn5k",
redirectPath: "/callback",
signinPath: "/api/signin",
};

export const CasdoorSDK = new Sdk(sdkConfig);
Expand All @@ -67,13 +68,13 @@ function App() {
saveTokenFromResponse={(res) => {
// @ts-ignore
// save token
localStorage.setItem("token", res.token);
localStorage.setItem("token", res.data.accessToken);
}}
isGetTokenSuccessful={(res) => {
// @ts-ignore
// according to the data returned by the server,
// determine whether the `token` is successfully obtained through `code` and `state`.
return res.status === "ok";
return res.success === true;
}}
/>
);
Expand Down Expand Up @@ -133,4 +134,3 @@ function HomePage() {

export default HomePage;
```

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"@types/react": "^18.0.17",
"@types/react-dom": "^18.0.6",
"@types/react-test-renderer": "^18.0.0",
"casdoor-js-sdk": "^0.3.0",
"casdoor-js-sdk": "^0.10.0",
"eslint": "^8.23.0",
"eslint-plugin-react": "^7.31.1",
"isomorphic-fetch": "^3.0.0",
Expand Down
8 changes: 4 additions & 4 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -1663,10 +1663,10 @@ cardinal@^2.1.1:
ansicolors "~0.3.2"
redeyed "~2.1.0"

casdoor-js-sdk@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/casdoor-js-sdk/-/casdoor-js-sdk-0.3.0.tgz#89475e30e16f10082e2bf5b78b94324c7bce1b64"
integrity sha512-Mf0OEOGrD6cU8X+gzsgeZrKvC9JxHobgCHeBlKHMvNWKeU4J3sfmhWonOwF4iFnbvrK7I2a5YOpO9gAoSayB1g==
casdoor-js-sdk@^0.10.0:
version "0.10.0"
resolved "https://registry.yarnpkg.com/casdoor-js-sdk/-/casdoor-js-sdk-0.10.0.tgz#aba3014a835820f47c20905fa84ab9773e65fa2a"
integrity sha512-PmSNNDhABCtki0C6DmBF01a5XieL1ilHlXa4+m7xur24/Rj+WnKJFxvXIPHlnzqFntFXkJMW0nxuwSV+47TpLA==

chalk@^2.0.0, chalk@^2.3.2:
version "2.4.2"
Expand Down

0 comments on commit 8f90c5e

Please sign in to comment.