🎉 Initial Auth

This commit is contained in:
Liyas Thomas
2020-01-20 22:25:48 +05:30
parent cd2680135d
commit fb4554abe3
7 changed files with 1153 additions and 18 deletions

View File

@@ -345,6 +345,17 @@
</template>
</v-popover>
</span>
<Login v-if="!store.currentUser" />
<div v-else>
<button @click="logout">Log out</button>
<InputForm />
<BallsFeed />
</div>
</div>
</header>
<nuxt />
@@ -594,10 +605,22 @@
import intializePwa from "../assets/js/pwa";
import * as version from "../.postwoman/version.json";
import firebase from 'firebase/app';
import 'firebase/auth';
import { store } from '../functions/store';
import Login from '../components/Login';
import InputForm from '../components/InputForm';
import BallsFeed from '../components/BallsFeed';
export default {
components: {
logo: () => import("../components/logo"),
modal: () => import("../components/modal")
modal: () => import("../components/modal"),
Login, InputForm, BallsFeed
},
methods: {
@@ -606,7 +629,13 @@ export default {
"nuxt-link-exact-active": this.$route.path === path,
"nuxt-link-active": this.$route.path === path
};
}
},
logout() {
firebase.auth().signOut()
.catch((err) => alert(err.message || err));
},
},
data() {
@@ -620,7 +649,9 @@ export default {
showShortcuts: false,
showSupport: false,
firefoxExtInstalled: window.firefoxExtSendRequest,
chromeExtInstalled: false
chromeExtInstalled: false,
store
};
},