Add bridge

This commit is contained in:
MartinBraquet
2025-10-30 12:40:00 +01:00
parent b6ed2c7dd8
commit 56edb51f36
2 changed files with 28 additions and 1 deletions

View File

@@ -88,7 +88,7 @@ export async function webviewGoogleSignin() {
const params = new URLSearchParams({
client_id: GOOGLE_CLIENT_ID,
redirect_uri: 'com.compassmeet:/auth', // your deep link
redirect_uri: 'https://www.compassmeet.com/auth/callback',
response_type: 'code',
scope: 'openid email profile',
code_challenge: codeChallenge,

View File

@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>Redirecting...</title>
<script>
(function() {
// Extract query string (includes ?code=...&state=...)
const params = new URLSearchParams(window.location.search);
const code = params.get('code');
const state = params.get('state');
console.log('/auth/callback code', code);
if (code) {
// Send code back to native app
const deepLink = `com.compassmeet://auth?code=${encodeURIComponent(code)}&state=${encodeURIComponent(state || '')}`;
window.location.href = deepLink;
} else {
document.body.textContent = 'Missing code in redirect.';
}
})();
</script>
</head>
<body>
Redirecting to app...
</body>
</html>