From 0fbd3b284e6bab07592a529542079925f0c50aff Mon Sep 17 00:00:00 2001 From: Joey Marshment-Howell Date: Mon, 23 Jan 2023 15:13:37 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=AA=9F=20=F0=9F=90=9B=20Force=20refresh?= =?UTF-8?q?=20of=20firebase=20token=20after=20verifying=20email=20(#21687)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/packages/cloud/lib/auth/GoogleAuthService.ts | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/airbyte-webapp/src/packages/cloud/lib/auth/GoogleAuthService.ts b/airbyte-webapp/src/packages/cloud/lib/auth/GoogleAuthService.ts index 32c11bf9f1c6..df0f42e91754 100644 --- a/airbyte-webapp/src/packages/cloud/lib/auth/GoogleAuthService.ts +++ b/airbyte-webapp/src/packages/cloud/lib/auth/GoogleAuthService.ts @@ -20,6 +20,8 @@ import { signInWithPopup, GoogleAuthProvider, GithubAuthProvider, + getIdToken, + reload, } from "firebase/auth"; import { Provider } from "config"; @@ -144,7 +146,13 @@ export class GoogleAuthService { } async confirmEmailVerify(code: string): Promise { - return applyActionCode(this.auth, code); + await applyActionCode(this.auth, code); + + // Reload the user and get a fresh token with email_verified: true + if (this.auth.currentUser) { + await reload(this.auth.currentUser); + await getIdToken(this.auth.currentUser, true); + } } async signInWithEmailLink(email: string): Promise {