Created
June 28, 2017 09:17
-
-
Save xerosanyam/5d23802acfb48b24d9e22dcfcc2fff7e to your computer and use it in GitHub Desktop.
first step
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
<!-- 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