MVT*_*KVM 5 javascript google-authentication access-token oauth-2.0 firebase
GoogleAuthProvider我在 Vue 2 应用程序中使用 Firebase来登录用户。我将日历添加到提供程序的范围中,以便访问用户的日历。然后,我使用结果中给出的 access_token 来检索事件。问题是accessToken一小时后就会过期。我怎样才能更新它?
这是我处理登录的代码:
const auth = getAuth();
const provider = new GoogleAuthProvider();
provider.addScope("https://www.googleapis.com/auth/calendar");
const result = await signInWithPopup(auth, provider);
const credential = GoogleAuthProvider.credentialFromResult(result);
const token = credential.accessToken;
const user = result.user;
await this.checkUser(user, token);
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
729 次 |
| 最近记录: |