Auth-module: onRedirect not triggering for oAuth login

Created on 18 Jun 2019  Â·  4Comments  Â·  Source: nuxt-community/auth-module

Version

v4.7.0

Reproduction link

htttps://unvail.able

Steps to reproduce

I need localized redirects on login, so I have the following config:

In nuxt.config

        redirect: {
            …
            home: '/login-landing'
        }, 

in a plugin:

app.$auth.onRedirect((to, from) => {
        if (to === '/login-landing') {
            // return localized path
        }

        return to;
    });

This works great for normal logins, but is not triggered for an oAuth-Login via google.

Sorry I can not provide an example repo, but this needs a Google-oAuth setup to try it out.

What is expected ?

onRedirect should be triggered

What is actually happening?

onRedirect is not triggered

This bug report is available on Nuxt community (#c358)
bug

Most helpful comment

any updates on this?....

All 4 comments

Same problem here

I can also confirm that this is an issue when using the Google provider.

When $auth triggers _handleCallback, it is triggered before the plugins defined in auth inside the nuxt.config are instanciated.

Therefore, when the login callback redirect is triggered, there is nothing populated inside _redirectListeners.

True for version 4.8.1.

any updates on this?....

Was this page helpful?
0 / 5 - 0 ratings

Related issues

nikkanetiya picture nikkanetiya  Â·  3Comments

DiegoGallegos4 picture DiegoGallegos4  Â·  3Comments

Amoki picture Amoki  Â·  3Comments

dasisyouyu picture dasisyouyu  Â·  3Comments

aaronhuisinga picture aaronhuisinga  Â·  3Comments