-
Story: As an app developer, my app is developed for organizations with different domains than Gmail, Outlook, Hotmail, and so on. I'd like to prevent those users from signing up and show them an appropriate error message to understand why they're being turned down. auth.server.ts
auth.google.callback.tsx
auth.success.tsx
The above code will work to prevent users with @gmail from accessing the application. However, I can't seem to display an appropriate message. If I remove the successRedirect on callback, I can check if the userId is invalid and redirect to the message I'd like the user to see. But then I can't seem to redirect on success anymore and thus break login altogether. How can I prevent & show a custom message that I don't allow gmail accounts? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
You can use the sessionErrorKey to access the errors, check https://github.com/sergiodxa/remix-auth#errors-handling |
Beta Was this translation helpful? Give feedback.
You can use the sessionErrorKey to access the errors, check https://github.com/sergiodxa/remix-auth#errors-handling