Files
hoppscotch/components/Login.vue
Liyas Thomas 87be0b3d3d 🎉 Initial Auth
2020-01-23 16:41:23 +05:30

31 lines
724 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";
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>