Version
v4.9.1
Reproduction link
https://nuxt-auth.herokuapp.com/callback?error=access_denied&error_description=The%20user%20has%20denied%20your%20application%20access.&error_uri=https%3A%2F%2Fdocs.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23access-denied&state=mk-asdfasdf
Steps to reproduce
If something goes wrong with OAuth, or the user clicks "cancel" partway through, they are redirected to the callback page and no error mechanism is available. onError isn't thrown, and there's no built-in convenience methods to deal with this. The error is not displayed on the page, and the nuxt error page is not displayed. The code just bails:
Digging through the code, it does seem that fetchUser is called in this situation, and it would /seem/ like callOnError should be called as a result:
|
this.callOnError(error, { method: 'fetchUser' }) |
However, in this case, oauth2 just returns outright, which is not an error to be caught, and so it all falls right through.
The demo app is affected by this bug: https://nuxt-auth.herokuapp.com/callback?error=access_denied&error_description=The%20user%20has%20denied%20your%20application%20access.&error_uri=https%3A%2F%2Fdocs.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23access-denied&state=mk-asdfasdf
What is expected ?
I'd expect there to be some way to handle these types of errors. Probably a hook for receiving the error message, and probably a redirect - to home or login page or error page.
What is actually happening?
User sees endless spinner and there's no built-in way to catch it.
Additional comments?
This seems like it should be core functionality? Am I missing something?
This bug report is available on Nuxt community (#c706)
Version
v4.9.1
Reproduction link
https://nuxt-auth.herokuapp.com/callback?error=access_denied&error_description=The%20user%20has%20denied%20your%20application%20access.&error_uri=https%3A%2F%2Fdocs.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23access-denied&state=mk-asdfasdf
Steps to reproduce
If something goes wrong with OAuth, or the user clicks "cancel" partway through, they are redirected to the callback page and no error mechanism is available.
onErrorisn't thrown, and there's no built-in convenience methods to deal with this. The error is not displayed on the page, and the nuxt error page is not displayed. The code just bails:auth-module/src/schemes/oauth2.ts
Line 345 in 5772ccb
Digging through the code, it does seem that fetchUser is called in this situation, and it would /seem/ like callOnError should be called as a result:
auth-module/src/core/auth.ts
Line 155 in 6ab4c1e
However, in this case, oauth2 just returns outright, which is not an error to be caught, and so it all falls right through.
The demo app is affected by this bug: https://nuxt-auth.herokuapp.com/callback?error=access_denied&error_description=The%20user%20has%20denied%20your%20application%20access.&error_uri=https%3A%2F%2Fdocs.github.com%2Fapps%2Fmanaging-oauth-apps%2Ftroubleshooting-authorization-request-errors%2F%23access-denied&state=mk-asdfasdf
What is expected ?
I'd expect there to be some way to handle these types of errors. Probably a hook for receiving the error message, and probably a redirect - to home or login page or error page.
What is actually happening?
User sees endless spinner and there's no built-in way to catch it.
Additional comments?
This seems like it should be core functionality? Am I missing something?