Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Login to the last account instead of the new account #15

Open
rahman1126 opened this issue May 15, 2018 · 1 comment
Open

Login to the last account instead of the new account #15

rahman1126 opened this issue May 15, 2018 · 1 comment

Comments

@rahman1126
Copy link

Hi, i have problem when login, i tried with 2 accounts, i tried login and then logout from account A, and re login with account B, but keep me logged in with account A.

here is my code, its quite similar with the sample code.

    openGoogleLoginDialog () {
        Vue.googleAuth().signIn(this.onSignInSuccess, this.onSignInError)
    },

   onSignInSuccess: function (authorizationCode) {
        let auth2 = gapi.auth2.getAuthInstance();
        let signedIn = auth2.isSignedIn.get()

        let user = auth2.currentUser.get().getBasicProfile();

        let data = {
            'provider': 'google',
            'id': user.getId(),
            'name': user.getName(),
            'email': user.getEmail(),
            'avatar': user.getImageUrl()
        }
        console.log(data)
        this.$store.dispatch('authenticate', data)
        .then((res) => {
            // console.log(res)
            this.$store.dispatch('loadNotifications')
            this.$router.push('/')
        })
        .catch((err) =>{
            console.log(err)
        })
    },
@pallamollasai
Copy link

I was also facing same issue. Intially I thought its an issue of vue-google-auth. Later found out this problem has nothing to do with vue-google-auth. (I don't think it's an issue) It is default behaviour which was originated from google itself. I checked the same behavior in quora and jiira (where I had two google accounts first I sign with personal account and logged out from both quora and google. But when I again logged in with another(with [email protected]) it was taking old(personal account rather than work)). I think google might have some sessions are cookies are stored in browser.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants