🎉 Initial Auth

This commit is contained in:
Liyas Thomas
2020-01-20 22:25:48 +05:30
parent 27585d5c93
commit 87be0b3d3d
7 changed files with 1150 additions and 17 deletions

30
components/Login.vue Normal file
View File

@@ -0,0 +1,30 @@
<template>
<div>
<button @click.prevent="signInWithGoogle">Log in with Google</button>
<button @click.prevent="signInWithGithub">Log in with GitHub</button>
</div>
</template>
<script>
import firebase from "firebase/app";
import "firebase/auth";
export default {
methods: {
signInWithGoogle() {
var provider = new firebase.auth.GoogleAuthProvider();
firebase
.auth()
.signInWithPopup(provider)
.catch(err => alert(err.message || err));
},
signInWithGithub() {
var provider = new firebase.auth.GithubAuthProvider();
firebase
.auth()
.signInWithPopup(provider)
.catch(err => alert(err.message || err));
}
}
};
</script>