File tree Expand file tree Collapse file tree 2 files changed +6
-3
lines changed
Expand file tree Collapse file tree 2 files changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -76,7 +76,7 @@ export const GOOGLE_CLIENT_ID = WEB_GOOGLE_CLIENT_ID
7676 * Authenticates a Firebase client running a webview APK on Android with Google OAuth.
7777 *
7878 * `https://accounts.google.com/o/oauth2/v2/auth?${params}` to get the code (in external browser, as google blocks it in webview)
79- * Redirects to `com.compassmeet:/auth` (in webview java main activity)
79+ * Redirects to `com.compassmeet:// auth` (in webview java main activity)
8080 * 'https://oauth2.googleapis.com/token' to get the ID token (in javascript app)
8181 * signInWithCredential(auth, credential) to set up firebase user in client (auth.currentUser)
8282 *
Original file line number Diff line number Diff line change @@ -69,8 +69,11 @@ function MyApp({Component, pageProps}: AppProps<PageProps>) {
6969 console . log ( 'Registering OAuth redirect listener for Android WebView' )
7070
7171 window . addEventListener ( 'oauthRedirect' , async ( event : any ) => {
72+ console . log ( 'Received oauthRedirect event' ) ;
7273 console . log ( 'Received oauthRedirect event:' , event . detail ) ;
73- const url = new URL ( event . detail ) ;
74+ const detail = typeof event . detail === 'string' ? JSON . parse ( event . detail ) : event . detail
75+ console . log ( 'OAuth data:' , detail ) ;
76+ const url = new URL ( detail ) ;
7477
7578 const code = url . searchParams . get ( 'code' ) ;
7679 if ( ! code ) {
@@ -87,7 +90,7 @@ function MyApp({Component, pageProps}: AppProps<PageProps>) {
8790 client_id : GOOGLE_CLIENT_ID ,
8891 code,
8992 code_verifier : codeVerifier ! ,
90- redirect_uri : 'com.compassmeet:/auth' ,
93+ redirect_uri : 'com.compassmeet:// auth' ,
9194 grant_type : 'authorization_code' ,
9295 } ) ,
9396 } ) ;
You can’t perform that action at this time.
0 commit comments