Skip to content

Instantly share code, notes, and snippets.

@h-sakano
Created September 19, 2018 03:42
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save h-sakano/07fae52532f2ac8fc3924eeb723ee8c6 to your computer and use it in GitHub Desktop.
Save h-sakano/07fae52532f2ac8fc3924eeb723ee8c6 to your computer and use it in GitHub Desktop.
Firebase Authentication GoogleSignin Component
<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