Pants
06/21/2022, 6:29 PMrp
06/21/2022, 6:45 PMmwill8886
06/21/2022, 8:43 PMdoesSessionExist
and isEmailVerified
from supertokens-auth-react
to check on protected pages, if they do not have a session they get redirected and if the email is not verified they get redirected. My issue comes when I'm testing my pages with Cypress. Whenever Cypress loads up pages it fires off a request to /auth/session/refresh
. If i just have Cypress set a cookie sIRTFrontend: remove
it gets passed that request. But when It gets to my protected route wrapper and checks for doesSessionExist
it will fail. My questions are:
1: How should we be mocking either a response for /auth/session/refresh
or setting those cookies?
2: How should we be mocking the cookies so doesSessionExist
actually returns true?
As of now I can set some cookies for doesSessionExist
with false data that just returns true but i cannot use that in conjunction with my solution for bypassing /auth/session/refresh
funk101
06/21/2022, 9:58 PMshivam51
06/22/2022, 4:46 AMrp
06/22/2022, 5:04 AMrp
06/22/2022, 5:33 AMrp
06/22/2022, 5:40 AMEdwinN1337
06/22/2022, 7:38 AMrp
06/22/2022, 7:40 AMEdwinN1337
06/22/2022, 7:55 AMSupreme Commander
06/22/2022, 8:46 AMRomain
06/22/2022, 9:30 AMRomain
06/22/2022, 12:15 PMyuriy
06/22/2022, 2:01 PMsignIn(email, password)
called from within a component. Similarly to how you can use the signOut()
function?
Thanks a lot,
BR,
Yuriyfunk101
06/22/2022, 2:08 PMonChange
event. However, it's firing on a "blur" event.flixoflax
06/23/2022, 7:02 AMromanpalenik
06/23/2022, 11:57 AMrp
06/23/2022, 12:50 PMnox
06/23/2022, 1:40 PMPPaii
06/23/2022, 1:55 PMMichael Brant
06/23/2022, 5:46 PMMichael Brant
06/24/2022, 3:12 AMrp
06/24/2022, 3:57 AMEdwinN1337
06/24/2022, 9:13 AM_app.tsx
(nextjs app)
js
if (typeof window !== 'undefined') {
supertokens.init({
...frontendConfig().appInfo,
})
}
In our Layout
component we initialize the user, by running a effect (which is client side) to getUser()
in our zustand storetwistingtwists
06/24/2022, 4:04 PMtwistingtwists
06/24/2022, 4:04 PMtwistingtwists
06/24/2022, 4:04 PMCaptainPhoton
06/24/2022, 4:49 PMrp
06/24/2022, 4:49 PM