Updates SuperTokens dependency version (#25102)
It's a change to the package.json file to update the supertokens-auth-react version. The changes in this version are: - How supertokens session works in the context of an iframe - Dependencies of supertokens-auth-react now use a `^` -------- One more change is to do with how the redirection works in the demo app in case of session expiry or if a user clicks on signout.
This commit is contained in:
parent
7d75bc3ed1
commit
8fe30fe49e
2 changed files with 8 additions and 4 deletions
|
@ -11,7 +11,7 @@
|
|||
"next": "latest",
|
||||
"react": "17.0.1",
|
||||
"react-dom": "17.0.1",
|
||||
"supertokens-auth-react": "^0.12.0",
|
||||
"supertokens-auth-react": "^0.13.0",
|
||||
"supertokens-node": "^5.0.0"
|
||||
},
|
||||
"license": "MIT"
|
||||
|
|
|
@ -42,13 +42,17 @@ export default function Home(props) {
|
|||
function ProtectedPage({ userId }) {
|
||||
async function logoutClicked() {
|
||||
await ThirdPartyEmailPassword.signOut()
|
||||
window.location.href = '/auth'
|
||||
ThirdPartyEmailPassword.redirectToAuth()
|
||||
}
|
||||
|
||||
async function fetchUserData() {
|
||||
const res = await fetch('/api/user')
|
||||
const json = await res.json()
|
||||
alert(JSON.stringify(json))
|
||||
if (res.status === 401) {
|
||||
ThirdPartyEmailPassword.redirectToAuth()
|
||||
} else {
|
||||
const json = await res.json()
|
||||
alert(JSON.stringify(json))
|
||||
}
|
||||
}
|
||||
|
||||
return (
|
||||
|
|
Loading…
Reference in a new issue