When does Nuxt Auth attempt to authenticate

51 views Asked by At

I've been trying to understand the timeline process of when nuxt-auth attempts to authenticate.

I have the following strategy:

        strategies: {
            local: false,
            password_grant: {
                scheme: 'local',
                token: {
                    property: 'access_token'
                },
                endpoints: {
                    login: {
                        url: '/oauth/token',
                        method: 'post',
                        propertyName: 'access_token'
                    },
                    logout: false,
                    user: {
                        url: 'api/auth/me',
                        method: 'get',
                        propertyName: 'user'
                    },
                }
            },

So, does this authentication occur before any components are loaded? And, since the axios process is asynchronous, does nuxt-auth wait for the authentication response, before loading the components?

I have a user who is having an issue, where a component calls asyncdata() and the api response does not have the user authenticated. However, on the client side data the user is logged in. I am trying to debug why this issue is occuring for this user. My instinct is it has to do with the access token not being sent in the cookies to the server. Any suggestions are appreciated.

0

There are 0 answers