Created
September 19, 2018 03:42
-
-
Save h-sakano/07fae52532f2ac8fc3924eeb723ee8c6 to your computer and use it in GitHub Desktop.
Firebase Authentication GoogleSignin Component
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<a class="google-signin" @click="signInWithGoogleRedirect"></a> | |
</template> | |
<script lang="ts"> | |
import { | |
Component, | |
Vue | |
} from "nuxt-property-decorator" | |
import firebase, { googleProvider } from "~/plugins/firebase" | |
@Component({}) | |
export default class GoogleSignin extends Vue { | |
public signInWithGoogleRedirect () { | |
firebase.auth().signInWithRedirect(googleProvider) | |
} | |
} | |
</script> | |
<style scoped> | |
a.google-signin { | |
display: block; | |
cursor: pointer; | |
background-image: url(~/assets/images/btn_google_signin_dark_normal_web.png); | |
width: 191px; | |
height: 46px; | |
} | |
</style> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment