How do I implement after a user sets their password I want to automatically log them in if it was su...
s
How do I implement after a user sets their password I want to automatically log them in if it was successful? I am using Next.js
r
hey @Sekai you mean during the password reset flow?>
s
Kind of
I am using a custom page
I'm using client invite flow
Where a admin user creates a new user and that user gets a email link
but after the user sets their password I want them to log in automatically
r
you can override the api that is called to set the password, and at the end of it, call the session.createnewsession function from our sdk
s
Hey, I am trying this right now and I'm not sure I am in the right track but do I need to use the createNewSession without req / res dependency since I can't call the createnewsession with req/res in the backend config file for overriding the api
I get a invalid URL doing with the req/res
r
can i see code of the api override?
s
I was able to do it in client side
but I need req and res for it
r
yup, in our overrides you have the req and res object from
input.options.req
and
input.options.res
(assuming you are doing an api override)
s
ohh in the input
r
which is what you should be doing
s
That makes sense
I was like how do I get the res and req
It worked
Thank you @rp_st
3 Views