signInByEmail(email,password) {
return this.afAuth.auth.signInWithEmailAndPassword(email, password)
.then(
(success)=> {
this.afAuth.auth.currentUser.getIdToken()
.then(token => {
let params = new URLSearchParams();
params.set('tsid', `Bearer ${token}`);
this.auth.setToken(token);
});
localStorage.setItem('emailUser', email);
this.router.navigateByUrl('/');
}
).catch(
(err)=> {
this.showAlert();
console.log(err);
}
);
}
signInByGoogle(){
return this.afAuth.auth.signInWithPopup(new firebase.auth.GoogleAuthProvider()).then(
(success)=> {
this.afAuth.auth.currentUser.getIdToken()
.then(token => {
let params = new URLSearchParams();
params.set('tsid', `Bearer ${token}`);
this.auth.setToken(token);
});
localStorage.setItem('emailUser', JSON.stringify(success.user.email));
this.router.navigateByUrl('/');
}
).catch(
(err)=> {
console.log(err);
}
);
}
app-root中有HostBending
export class AppComponent implements OnInit {
@HostBinding('class.layout-fixed') get isFixed() { return this.settings.layout.isFixed; };
}
答案 0 :(得分:0)
我找到了这个问题的答案 社交链接登录按钮必须在标签内