Skip to content

Commit 56edb51

Browse files
committed
Add bridge
1 parent b6ed2c7 commit 56edb51

File tree

2 files changed

+28
-1
lines changed

2 files changed

+28
-1
lines changed

web/lib/firebase/users.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ export async function webviewGoogleSignin() {
8888

8989
const params = new URLSearchParams({
9090
client_id: GOOGLE_CLIENT_ID,
91-
redirect_uri: 'com.compassmeet:/auth', // your deep link
91+
redirect_uri: 'https://www.compassmeet.com/auth/callback',
9292
response_type: 'code',
9393
scope: 'openid email profile',
9494
code_challenge: codeChallenge,

web/pages/auth/callback.html

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>Redirecting...</title>
6+
<script>
7+
(function() {
8+
// Extract query string (includes ?code=...&state=...)
9+
const params = new URLSearchParams(window.location.search);
10+
const code = params.get('code');
11+
const state = params.get('state');
12+
console.log('/auth/callback code', code);
13+
14+
if (code) {
15+
// Send code back to native app
16+
const deepLink = `com.compassmeet://auth?code=${encodeURIComponent(code)}&state=${encodeURIComponent(state || '')}`;
17+
window.location.href = deepLink;
18+
} else {
19+
document.body.textContent = 'Missing code in redirect.';
20+
}
21+
})();
22+
</script>
23+
</head>
24+
<body>
25+
Redirecting to app...
26+
</body>
27+
</html>

0 commit comments

Comments
 (0)