mirror of
https://github.com/romancm/gamebrary
synced 2024-11-14 23:47:08 +00:00
Handle redirects at root level
This commit is contained in:
parent
b04d43b722
commit
92c37dc556
1 changed files with 17 additions and 7 deletions
24
src/App.vue
24
src/App.vue
|
@ -50,15 +50,25 @@ export default {
|
|||
},
|
||||
|
||||
mounted() {
|
||||
firebase.auth().getRedirectResult().then(({ user }) => {
|
||||
if (user) {
|
||||
this.init(user);
|
||||
this.syncData();
|
||||
}
|
||||
});
|
||||
|
||||
if (this.user) {
|
||||
this.syncData();
|
||||
this.$router.push({ name: 'platforms' });
|
||||
} else {
|
||||
firebase.auth().getRedirectResult().then(({ user }) => {
|
||||
if (user) {
|
||||
this.init(user);
|
||||
this.syncData();
|
||||
this.$router.push({ name: 'platforms' });
|
||||
} else {
|
||||
const GoogleAuth = new firebase.auth.GoogleAuthProvider();
|
||||
|
||||
firebase.auth().signInWithRedirect(GoogleAuth)
|
||||
.catch((error) => {
|
||||
/* eslint-disable */
|
||||
console.log(error);
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue