mirror of
https://github.com/chinchang/web-maker.git
synced 2025-07-18 12:31:12 +02:00
misc fixes
This commit is contained in:
16
src/auth.js
16
src/auth.js
@@ -1,8 +1,6 @@
|
||||
import {
|
||||
trackEvent
|
||||
} from './analytics';
|
||||
|
||||
import firebase from 'firebase/app'
|
||||
import { trackEvent } from './analytics';
|
||||
import firebase from 'firebase/app';
|
||||
import { log } from './utils';
|
||||
|
||||
export const auth = {
|
||||
logout() {
|
||||
@@ -24,15 +22,15 @@ export const auth = {
|
||||
return firebase
|
||||
.auth()
|
||||
.signInWithPopup(provider)
|
||||
.then(function () {
|
||||
.then(function() {
|
||||
trackEvent('fn', 'loggedIn', providerName);
|
||||
// Save to recommend next time
|
||||
window.db.local.set({
|
||||
lastAuthProvider: providerName
|
||||
});
|
||||
})
|
||||
.catch(function (error) {
|
||||
utils.log(error);
|
||||
.catch(function(error) {
|
||||
log(error);
|
||||
if (error.code === 'auth/account-exists-with-different-credential') {
|
||||
alert(
|
||||
'You have already signed up with the same email using different social login'
|
||||
@@ -40,4 +38,4 @@ export const auth = {
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user