Remove session mixin

This commit is contained in:
gamebrary 2024-07-17 11:11:16 -07:00
parent fb1f9863d8
commit 4337710490
3 changed files with 4 additions and 30 deletions

View file

@ -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' });
},
},

View file

@ -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,

View file

@ -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' });
},
},
};