Skip to content

Instantly share code, notes, and snippets.

@xerosanyam
Created June 28, 2017 09:17
Show Gist options
  • Save xerosanyam/5d23802acfb48b24d9e22dcfcc2fff7e to your computer and use it in GitHub Desktop.
Save xerosanyam/5d23802acfb48b24d9e22dcfcc2fff7e to your computer and use it in GitHub Desktop.
first step
<!-- Contains auth ui -->
<template lang="html">
<div id="firebaseui-auth-container"></div>
</template>
<script>
import firebase from 'firebase'
import firebaseui from 'firebaseui'
import {config} from '../helpers/firebaseConfig';
export default {
name: 'auth',
mounted() {
var vm = this
var uiConfig = {
callbacks: {
signInSuccess: function(currentUser, credential, redirectUrl) {
vm.$emit('loggedIn')
return false;
}
},
signInFlow: 'popup',
signInOptions: [
firebase.auth.GoogleAuthProvider.PROVIDER_ID,
firebase.auth.FacebookAuthProvider.PROVIDER_ID,
firebase.auth.TwitterAuthProvider.PROVIDER_ID,
{
provider: firebase.auth.EmailAuthProvider.PROVIDER_ID,
// Whether the display name should be displayed in the Sign Up page.
requireDisplayName: true
},
]
};
if(this.$root.ui!=''){
this.$root.ui.reset()
}else{
this.$root.ui = new firebaseui.auth.AuthUI(firebase.auth());
}
this.$root.ui.start('#firebaseui-auth-container', uiConfig);
}
}
</script>
<style lang="css">
</style>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment