Skip to content

Commit ccde6e4

Browse files
committed
Fix
1 parent 2c1c94d commit ccde6e4

File tree

2 files changed

+18
-27
lines changed

2 files changed

+18
-27
lines changed

web/pages/auth/callback.html

Lines changed: 0 additions & 27 deletions
This file was deleted.

web/pages/auth/callback.tsx

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import {useEffect} from "react";
2+
3+
export default function GoogleAuthCallback() {
4+
useEffect(() => {
5+
const params = new URLSearchParams(window.location.search);
6+
const code = params.get('code');
7+
const state = params.get('state');
8+
console.log('/auth/callback code', code);
9+
10+
if (code) {
11+
// Send code back to native app
12+
const deepLink = `com.compassmeet://auth?code=${encodeURIComponent(code)}&state=${encodeURIComponent(state || '')}`;
13+
window.location.href = deepLink;
14+
} else {
15+
document.body.textContent = 'Missing code in redirect.';
16+
}
17+
}, []);
18+
}

0 commit comments

Comments
 (0)