File tree 1 file changed +6
-5
lines changed
examples/with-supertokens/pages
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -16,19 +16,20 @@ export async function getServerSideProps(context) {
16
16
supertokensNode . init ( backendConfig ( ) )
17
17
let session
18
18
try {
19
- session = await Session . getSession ( context . req , context . res )
19
+ session = await Session . getSession ( context . req , context . res , {
20
+ overrideGlobalClaimValidators : async function ( ) {
21
+ return [ ]
22
+ } ,
23
+ } )
20
24
} catch ( err ) {
21
25
if ( err . type === Session . Error . TRY_REFRESH_TOKEN ) {
22
26
return { props : { fromSupertokens : 'needs-refresh' } }
23
27
} else if ( err . type === Session . Error . UNAUTHORISED ) {
24
28
// this will force the frontend to try and refresh which will fail
25
29
// clearing all cookies and redirecting the user to the login screen.
26
30
return { props : { fromSupertokens : 'needs-refresh' } }
27
- } else if ( err . type === Session . Error . INVALID_CLAIMS ) {
28
- return { props : { } }
29
- } else {
30
- throw err
31
31
}
32
+ throw err
32
33
}
33
34
34
35
return {
You can’t perform that action at this time.
0 commit comments