Redirect User Not Found to request access page
I have turned off self signup for a closed beta b2b saas app. We want to redirect people who try to login and get user not found to the request access screen. Is that possible?
5 Replies
Not currently functionality we support, but love the susgestion and have asked the team to look into it.
is there an api response i can get from the nextjs login component so do the redirect myself?
Or like if the user is not found, can i still use the getKindeSession or some equivalent to see that the user is not found and redirect them myself?
Also thanks for answering on the weekends, is slack a better place for these kinds of questions?
The below instructions could help you, but not 100% sure if you can redirect it to the request access page.
Create an API route to get the Kinde session data:
Fetch the session data in your client component and handle the redirection:
In this example, the API route checks if the user is authenticated using getKindeServerSession. If the user is not authenticated, it returns a 401 status. The client component fetches this data and redirects the user to the login page if they are not authenticated.
Here is perfectly fine, and it's our Monday morning for most of the team, so we are ready to help.
Hey @Tigerr this should probably exist, I 'll see if I can add it to the auth flow by the end of the week
The only way I can think of doing this right now would be to create a custom sign in screen and then check to see if a user with the email exists
if not then send them to knock knock (request access), otherwise log them in
thanks that might be what i have to do