mirror of
https://github.com/romancm/gamebrary
synced 2024-11-15 07:57:19 +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
16
src/App.vue
16
src/App.vue
|
@ -50,15 +50,25 @@ export default {
|
|||
},
|
||||
|
||||
mounted() {
|
||||
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);
|
||||
});
|
||||
}
|
||||
});
|
||||
|
||||
if (this.user) {
|
||||
this.syncData();
|
||||
}
|
||||
},
|
||||
|
||||
|
|
Loading…
Reference in a new issue