Files
hoppscotch/components/firebase/login.vue
Liyas Thomas 19a2323880 ♻️ Lint
2020-01-20 23:01:31 +05:30

30 lines
704 B
Vue

<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";
export default {
methods: {
signInWithGoogle() {
const provider = new firebase.auth.GoogleAuthProvider();
firebase
.auth()
.signInWithPopup(provider)
.catch(err => alert(err.message || err));
},
signInWithGithub() {
const provider = new firebase.auth.GithubAuthProvider();
firebase
.auth()
.signInWithPopup(provider)
.catch(err => alert(err.message || err));
}
}
};
</script>