Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
web-three-twitter-boilerplate/src/views/Login.vue
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
64 lines (58 sloc)
1.67 KB
This file contains 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> | |
<div class="login"> | |
<h1>Login</h1> | |
<div id="firebaseui-auth-container"></div> | |
<div id="loader">Loading...</div> | |
</div> | |
</template> | |
<script> | |
// @ is an alias to /src | |
import "firebaseui/dist/firebaseui.css"; | |
export default { | |
name: 'login', | |
mounted() { | |
/** | |
* Configuration | |
* @url https://github.com/firebase/firebaseui-web#configuration | |
*/ | |
ui.start('#firebaseui-auth-container', | |
{ | |
callbacks: { | |
signInSuccessWithAuthResult: (authResult, redirectUrl) => { | |
// console.log('Auth Result: ', authResult); | |
this.$store.commit('user', authResult.user); | |
this.$router.push({ | |
name: 'home' | |
}); | |
}, | |
uiShown: function() { | |
// The widget is rendered. | |
// Hide the loader. | |
document.getElementById('loader').style.display = 'none'; | |
} | |
}, | |
credentialHelper: false, | |
// Will use popup for IDP Providers sign-in flow instead of the default, redirect. | |
signInFlow: 'popup', | |
signInOptions: [ | |
// Leave the lines as is for the providers you want to offer your users. | |
firebase.auth.GoogleAuthProvider.PROVIDER_ID, | |
// firebase.auth.FacebookAuthProvider.PROVIDER_ID, | |
// firebase.auth.TwitterAuthProvider.PROVIDER_ID, | |
// firebase.auth.GithubAuthProvider.PROVIDER_ID, | |
firebase.auth.EmailAuthProvider.PROVIDER_ID, | |
// firebase.auth.PhoneAuthProvider.PROVIDER_ID | |
], | |
// Terms of service url. | |
tosUrl: '/terms', | |
// Privacy policy url. | |
privacyPolicyUrl: '/privacy' | |
}); | |
} | |
} | |
</script> | |
<style scoped lang="scss"> | |
template{ | |
padding-top: 70px; | |
} | |
</style> |