providers: {
myOauth2: {
name: 'myOauth2',
url: '/auth/myOauth2',
authorizationEndpoint: 'https://www.myOauth2.com/dialog/oauth',
redirectUri: getRedirectUri('/'),
requiredUrlParams: ['display', 'scope'],
scope: ['email'],
scopeDelimiter: ',',
display: 'popup',
oauthType: '2.0',
popupOptions: { width: 580, height: 400 }
},
google: {
name: 'google',
url: '/auth/google',
authorizationEndpoint: 'https://accounts.google.com/o/oauth2/auth',
redirectUri: getRedirectUri(),
requiredUrlParams: ['scope'],
optionalUrlParams: ['display'],
scope: ['profile', 'email'],
scopePrefix: 'openid',
scopeDelimiter: ' ',
display: 'popup',
oauthType: '2.0',
popupOptions: { width: 452, height: 633 }
},
All good!
methods: {
authenticate: function (provider) {
var this = this;
this.$auth.authenticate(provider).then(function () {
// Execute application logic after successful social authentication
console.log(this.$auth.getToken());
this.$router.push('/dashboard');
})
}
}
I needed to add the this_ , I was trying to use this.$auth.getToken() before but it was undefined.