Throwing errors from /api/login , conditional access #336
-
Hello, I was wondering if something like this was possible. I am trying to verify if the user has specific claims and if they do not, deny them access. I tried the following
And this crashes the site and I have no clue at what level is the error propagated/ where it should be caught as I don't really have access to any of the internals. This might be a question for FirebaseUI-React but considering that the error originates from '/login' endpoint I am guessing it's getting called by the Firebase-Next-Auth itself
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
Yes, what you're looking to do is possible but requires a little more customization. Right now, if the login/logout endpoints return a non-200 response, this library will throw. To handle errors in a different way, specify a custom |
Beta Was this translation helpful? Give feedback.
Yes, what you're looking to do is possible but requires a little more customization.
Right now, if the login/logout endpoints return a non-200 response, this library will throw. To handle errors in a different way, specify a custom
tokenChangedHandler
in your config. Yours might look like the default handler but with try/catch based on 403 responses.