Next.js Discord

Discord Forum

How to redirect users, when using auth.js default signIn page (api/auth/signin)

Answered
Macao paper wasp posted this in #help-forum
Open in Discord
Macao paper waspOP
Hello! My problem is that I don't know how can I redirect the users after a signIn is made from the default signIn page of auth.js, so by calling /api/auth/signin

Thanks for your answers!
Answered by joulev
iirc you can use it like this /api/auth/signin?callbackUrl=/admin
View full answer

8 Replies

Macao paper waspOP
This is my solution, I'm a beginner, should I change this scheme, to call a signIn function instead?
@Macao paper wasp This is my solution, I'm a beginner, should I change this scheme, to call a signIn function instead?
iirc you can use it like this /api/auth/signin?callbackUrl=/admin
Answer
Macao paper waspOP
Works smoothly, thank you very much!
Can I have another question, please?
yes, though please create a new post. it's late here so i'll go sleep, but other people may come and help
Macao paper waspOP
Sure, thank you!
Macao paper waspOP
@joulev please can you help with my other tickets? Thanks a lot