Hi, I have query, on click of magic link the new window will open, but the window where user is ask...
s
Hi, I have query, on click of magic link the new window will open, but the window where user is asked to enter the OTP , remains open, is there any way/function that will help me to auto refresh the OTP-window?
r
hey @shashank0959 you can override the component we have and add a useEffect in which you have a setInterval that checks for if a session exists, and if it does, then just reload the page.
s
okay thanks will try it.
hey @rp_st will getAccessTokenPayloadSecurely give me the info about if the user is sign-up or sign-in?
r
not really.
if you want that on the frontend, we have hooks for it
s
as I can see, there is no such parameter that will tell about it,
r
well, where do you want that info?
s
yeah, Needed in frontend, and searching for the function in reference, like you guys are using in handleOTP function response.createdNewRecipeUser && response.user.loginMethods.length === 1
r
yea, so if that's true, it means it's a sign up, else it's a sign in
s
yeah,,,
is there any hook that call help me,,
r
are you using pre built Ui?
s
no custome ui
r
right. So in the API response, you have the info you need to know if it's a sign up or sign in
s
yeah, actually, at perticular page, I want to know, if the user is sign up or sign in
r
right. So then you can save that info in localstorage or somewhere once the API is called
s
Let me explain me problem again, Actually on magic link a new page opens, which is consuming the magic link, but the page where the user needs to enter otp remains open means OTP-Page, So I need to reload the OTP-Page, for that I will need a function, So that I can run the function on reload of OTP-Page, That is why I need function to know if the user is sign-up or sing-in, but doesSessionExits only tell me, is session exixts or not,
r
so when the user consumes the magic link, save if it's a sign up or sign in in localstorage, and that value should ve visible in the other tab too
s
but what if, user uses the magic link in other device?
r
Well yea, that the session is created on the other device. Not much that can be done here.
s
okay understood
r
There is a blue box on the right. Select custom ui with it.
s
and this onHandleEvent is not available with custom-ui, I think?
r
Yea. Cause you call the APIs yourself anyway
s
okay okay got it