Skip to content

Commit

Permalink
Merge pull request #8 from cornell-dti/logout
Browse files Browse the repository at this point in the history
Han - Implement logout functionality
  • Loading branch information
handotdev authored Dec 7, 2019
2 parents 601d0ed + 998d162 commit ea5f4d9
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion src/components/SemesterView.vue
Original file line number Diff line number Diff line change
@@ -1,6 +1,9 @@
<template>
<div class="semesterView">
<div><button v-on:click="changeCompact">Change View</button></div>
<div>
<button v-on:click="changeCompact">Change View</button>
<button v-on:click="logout">Logout</button>
</div>
<!-- <confirmation text='Added "🌸 Spring 2020" to plan'/> -->
<div v-if="!compact" class="semesterView-content">
<div v-for="sem in semesters" v-bind:key="sem.id" class="semesterView-wrapper">
Expand All @@ -27,6 +30,7 @@

<script>
import Vue from 'vue';
import firebase from 'firebase';
import Course from '@/components/Course';
import Semester from '@/components/Semester';
// import Confirmation from '@/components/Confirmation';
Expand Down Expand Up @@ -65,6 +69,14 @@ export default {
methods: {
changeCompact() {
this.$emit('compact-updated', !this.compact);
},
logout() {
firebase.auth().signOut().then(() => {
window.location.reload(false);
}, error => {
// TODO: error
console.log(error);
});
}
}
};
Expand Down

0 comments on commit ea5f4d9

Please sign in to comment.