# Accessing this.$auth in vuejs right after loginWithRedirect()

**URL:** <https://community.auth0.com/t/accessing-this-auth-in-vuejs-right-after-loginwithredirect/34179>\
**Category:** Get Help\
**Tags:** login, auth0\
**Created:** [November 23, 2019, 11:37pm UTC](https://community.auth0.com/t/accessing-this-auth-in-vuejs-right-after-loginwithredirect/34179 "2019-11-23T23:37:29Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![rjskene83](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/rjskene83/32/15361_2.png) [@rjskene83](https://community.auth0.com/u/rjskene83)\
**Post date:** [November 23, 2019, 11:37pm UTC](https://community.auth0.com/t/accessing-this-auth-in-vuejs-right-after-loginwithredirect/34179/1 "2019-11-23T23:37:30Z")

</div>

I am using vuejs with the auth0 wrapper as outlined here:

> **[Add Login to Your Vue Application - Auth0 Docs](https://auth0.com/docs/quickstart/spa/vuejs)**
>
> This guide demonstrates how to integrate Auth0, add authentication, and display user profile information in any Vue application using the Auth0 Vue SDK.

I am having trouble accessing the this.$auth object immediately after a successful login.

I am using vuex and I want to update some state related to the user, assuming the login was successful.

After the redirect to the callback URL, if I try to execute code at the mounted() hook, I can access this.$auth and the Vue object details show an isAuthenticated attribute === true.

HOWEVER, if I try to access this.$auth.isAuthenticated within the same hook, in the same place, it comes back as false.

I can only access the correct value of this.$auth.isAuthenticated on some event after all elements have loaded. So for example, on @click of some element, the value returns true, without any other changes.

Hoping someone could explain how this.$auth object works.

---

<div class="post-metadata">

**Author:** ![jpbamberg](https://sea1.discourse-cdn.com/auth0/user_avatar/community.auth0.com/jpbamberg/32/16441_2.png) [@jpbamberg](https://community.auth0.com/u/jpbamberg)\
**Post date:** [March 25, 2020, 7:03pm UTC](https://community.auth0.com/t/accessing-this-auth-in-vuejs-right-after-loginwithredirect/34179/2 "2020-03-25T19:03:38Z")

</div>

I did this:

```auto
    setTimeout(
      function() {
        this.$auth.loginWithRedirect();
      }.bind(this),
      1
    );

```
