Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
1.1k views
in Technique[技术] by (71.8m points)

service worker - PWA - SignInWithPopup doesn't work in my Angular app

I'm using signinWithPopup for Google login in my Angular app and everything works fine. It looks like this:

  doGoogleLogin(){
    return new Promise<any>((resolve, reject) => {
      let provider = new firebase.auth.GoogleAuthProvider();
      provider.addScope('profile');
      provider.addScope('email');
      this.afAuth
      .signInWithPopup(provider)
      .then(res => {
        this.router.navigate([{outlets: {modal: null}}], { queryParamsHandling: 'merge', relativeTo: this.activatedRoute.parent}).then(()=>{
        this.notificationService.showSuccess('Logged In', 'You are now logged in.');
      }); // NAVIGATES BACK TO WWW.MYAPP.COM
      }, err => {
        // console.log(err);
      })
    })
  }

However, it doesn't work in my PWA version of it that I have installed on Android. Popup with 'Sign in - Google Accounts' opens, I click on my mail address, and it redirects me to myapp.firebaseapp.com/_auth/handler?state=AMBjfrojirjETC (the page is hosted on firebase) - however, the page is blank and doesn't get redirected to www.myapp.com (in web app everything works fine). When I close it, I'm back in my PWA and the login didn't happen. It's my first PWA and have no idea what goes wrong.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...