enigma_666
04/12/2023, 5:35 PMrp_st
04/12/2023, 5:37 PMrp_st
04/12/2023, 5:38 PMimport Session from "supertokens-auth-react/recipe/session";
Session.init({
    onHandleEvent: (context) => {
        if (context.action === "SIGN_OUT") {
            // called when the user clicks on sign out
        } else if (context.action === "REFRESH_SESSION") {
            // called with refreshing a session
            // NOTE: This is an undeterministic event
        } else if (context.action === "UNAUTHORISED") {
            // called when the user doesn't have a valid session but made a request that requires one
            // NOTE: This event can fire multiple times
            if (context.sessionExpiredOrRevoked) {
                // the sessionExpiredOrRevoked property is set to true if the current call cleared the session from storage
                // this happens only once, even if multiple tabs sharing the same session are open, making it useful for analytics purposes
            }
        } else if (context.action === "SESSION_CREATED") {
            // Called when session is created - post login / sign up.
        } else if (context.action === "ACCESS_TOKEN_PAYLOAD_UPDATED") {
            // This is called when the access token payload has been updated
        }
    }
})enigma_666
04/12/2023, 5:40 PMsession.getAccessTokenPayloadSecurely()session.getAccessTokenPayloadSecurely()rp_st
04/12/2023, 5:41 PMenigma_666
04/17/2023, 7:36 PMSession.getAccessTokenPayloadSecurelyrp_st
04/18/2023, 6:20 AMSession.getAccessTokenPayloadSecurely()enigma_666
04/18/2023, 12:22 PMSession.getAccessTokenPayloadSecurely()Session.getAccessTokenPayloadSecurely()rp_st
04/18/2023, 12:31 PMawait Session.getAccessTokenPayloadSecurely()enigma_666
04/18/2023, 1:07 PMSession.getAccessTokenPayloadSecurely()enigma_666
04/18/2023, 1:22 PMenigma_666
04/18/2023, 1:23 PMrp_st
04/18/2023, 1:23 PMawait Session.getAccessTokenPayloadSecurely()enigma_666
04/18/2023, 1:24 PMenigma_666
04/18/2023, 1:24 PMSession.getAccessTokenPayloadSecurely()rp_st
04/18/2023, 1:25 PMrp_st
04/18/2023, 1:25 PMawait Session.getAccessTokenPayloadSecurely()enigma_666
04/18/2023, 1:27 PMenigma_666
04/18/2023, 1:27 PMSESSION_CREATEDrp_st
04/18/2023, 1:30 PMenigma_666
04/18/2023, 1:47 PMrp_st
04/18/2023, 1:51 PM