mirror of
https://github.com/romancm/gamebrary
synced 2024-11-13 23:17:08 +00:00
Remove session mixin
This commit is contained in:
parent
fb1f9863d8
commit
4337710490
3 changed files with 4 additions and 30 deletions
|
@ -56,7 +56,6 @@ Elevate your gaming experience with PlayStats – because your gaming journey is
|
|||
import MarkdownCheatsheet from '@/components/MarkdownCheatsheet';
|
||||
import KeyboardShortcutsModal from '@/components/KeyboardShortcutsModal';
|
||||
import PageHeader from '@/components/PageHeader';
|
||||
import sessionMixin from '@/mixins/sessionMixin';
|
||||
import { initializeApp } from "firebase/app";
|
||||
import { mapState, mapGetters } from 'vuex';
|
||||
import { KEYBOARD_SHORTCUTS, FIREBASE_CONFIG, IGDB_QUERIES } from '@/constants';
|
||||
|
@ -72,8 +71,6 @@ export default {
|
|||
KeyboardShortcutsModal,
|
||||
},
|
||||
|
||||
mixins: [sessionMixin],
|
||||
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
|
@ -117,7 +114,10 @@ export default {
|
|||
|
||||
watch: {
|
||||
sessionExpired(expired) {
|
||||
if (expired) this.session_handleExpiredSession();
|
||||
if (!expired) return;
|
||||
|
||||
this.$store.commit('CLEAR_SESSION');
|
||||
this.$router.replace({ name: 'auth' });
|
||||
},
|
||||
},
|
||||
|
||||
|
|
|
@ -64,11 +64,7 @@ import { FIREBASE_CONFIG } from '@/constants';
|
|||
|
||||
const app = initializeApp(FIREBASE_CONFIG);
|
||||
|
||||
import sessionMixin from '@/mixins/sessionMixin';
|
||||
|
||||
export default {
|
||||
mixins: [sessionMixin],
|
||||
|
||||
data() {
|
||||
return {
|
||||
progress: 0,
|
||||
|
|
|
@ -1,22 +0,0 @@
|
|||
// TODO: remove
|
||||
import firebase from 'firebase/compat/app';
|
||||
import 'firebase/compat/auth';
|
||||
|
||||
export default {
|
||||
methods: {
|
||||
session_signOut() {
|
||||
firebase.auth().signOut()
|
||||
.then(() => {
|
||||
this.session_handleExpiredSession();
|
||||
})
|
||||
.catch((error) => {
|
||||
this.$bvToast.toast(error, { title: 'Error', variant: 'danger' });
|
||||
});
|
||||
},
|
||||
|
||||
session_handleExpiredSession() {
|
||||
this.$store.commit('CLEAR_SESSION');
|
||||
this.$router.replace({ name: 'auth' });
|
||||
},
|
||||
},
|
||||
};
|
Loading…
Reference in a new issue