mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-05-18 13:47:08 -04:00
Fix
This commit is contained in:
@@ -76,7 +76,7 @@ export const GOOGLE_CLIENT_ID = WEB_GOOGLE_CLIENT_ID
|
||||
* Authenticates a Firebase client running a webview APK on Android with Google OAuth.
|
||||
*
|
||||
* `https://accounts.google.com/o/oauth2/v2/auth?${params}` to get the code (in external browser, as google blocks it in webview)
|
||||
* Redirects to `com.compassmeet:/auth` (in webview java main activity)
|
||||
* Redirects to `com.compassmeet://auth` (in webview java main activity)
|
||||
* 'https://oauth2.googleapis.com/token' to get the ID token (in javascript app)
|
||||
* signInWithCredential(auth, credential) to set up firebase user in client (auth.currentUser)
|
||||
*
|
||||
|
||||
@@ -69,8 +69,11 @@ function MyApp({Component, pageProps}: AppProps<PageProps>) {
|
||||
console.log('Registering OAuth redirect listener for Android WebView')
|
||||
|
||||
window.addEventListener('oauthRedirect', async (event: any) => {
|
||||
console.log('Received oauthRedirect event');
|
||||
console.log('Received oauthRedirect event:', event.detail);
|
||||
const url = new URL(event.detail);
|
||||
const detail = typeof event.detail === 'string' ? JSON.parse(event.detail) : event.detail
|
||||
console.log('OAuth data:', detail);
|
||||
const url = new URL(detail);
|
||||
|
||||
const code = url.searchParams.get('code');
|
||||
if (!code) {
|
||||
@@ -87,7 +90,7 @@ function MyApp({Component, pageProps}: AppProps<PageProps>) {
|
||||
client_id: GOOGLE_CLIENT_ID,
|
||||
code,
|
||||
code_verifier: codeVerifier!,
|
||||
redirect_uri: 'com.compassmeet:/auth',
|
||||
redirect_uri: 'com.compassmeet://auth',
|
||||
grant_type: 'authorization_code',
|
||||
}),
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user