]>
git.r.bdr.sh - rbdr/dasein/blob - app/components/login.js
2 import AuthService
from '../services/auth';
6 export default internals
.LoginComponent
= Vue
.component('login', {
7 template: '<div class="login-container">' +
11 props: ['oAuthToken', 'oAuthVerifier'],
16 message: 'Logging you in... Wait a sec.',
17 authService: new AuthService()
23 if (this.authService
.authenticated
) {
24 return this.$router
.push('/');
27 return this.authService
.getUserObject(this.oAuthToken
, this.oAuthVerifier
).then((response
) => {
29 console
.log(response
);
31 return this.authService
.login(response
.user
, response
.token
, response
.expiresAt
);
34 this.$router
.push('/');
38 this.message
= 'Oh no! There was a problem logging you in.';
42 mounted: function mounted() {