Commit 7fda321 1 parent 76e4946 commit 7fda321 Copy full SHA for 7fda321
File tree 2 files changed +7
-4
lines changed
web-js-sdk/src/enhancers/withNotifications
2 files changed +7
-4
lines changed Original file line number Diff line number Diff line change @@ -24,6 +24,7 @@ const extractSession = (
24
24
const getSessionFromCookie = async (
25
25
config ?: CreateSdkParams
26
26
) : Promise < AuthenticationInfo | undefined > => {
27
+ console . debug ( 'attempting to get session from cookie' ) ;
27
28
try {
28
29
const sessionCookie = ( await cookies ( ) ) . get (
29
30
descopeSdk . SessionTokenCookieName
@@ -33,8 +34,7 @@ const getSessionFromCookie = async (
33
34
return undefined ;
34
35
}
35
36
const sdk = getGlobalSdk ( config ) ;
36
- const res = await sdk . validateJwt ( sessionCookie . value ) ;
37
- return res ;
37
+ return await sdk . validateJwt ( sessionCookie . value ) ;
38
38
} catch ( err ) {
39
39
console . debug ( 'Error getting session from cookie' , err ) ;
40
40
return undefined ;
Original file line number Diff line number Diff line change @@ -34,8 +34,11 @@ export const withNotifications =
34
34
await getAuthInfoFromResponse ( res ) ;
35
35
if ( sessionJwt ) sessionPS . pub ( sessionJwt ) ;
36
36
37
- if ( sessionExpiration ) {
38
- sessionExpirationPS . pub ( sessionExpiration ) ;
37
+ if ( sessionExpiration || sessionJwt ) {
38
+ // We also publish the session expiration if there is a session jwt
39
+ // as a temporary fix for the issue where the session expiration is not
40
+ // being sent in the response in Flows (42 is a magic number)
41
+ sessionExpirationPS . pub ( sessionExpiration || 42 ) ;
39
42
}
40
43
}
41
44
} ;
You can’t perform that action at this time.
0 commit comments