mirror of
https://github.com/CompassConnections/Compass.git
synced 2026-04-16 12:38:19 -04:00
Fix
This commit is contained in:
@@ -1,27 +0,0 @@
|
||||
<!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>
|
||||
18
web/pages/auth/callback.tsx
Normal file
18
web/pages/auth/callback.tsx
Normal file
@@ -0,0 +1,18 @@
|
||||
import {useEffect} from "react";
|
||||
|
||||
export default function GoogleAuthCallback() {
|
||||
useEffect(() => {
|
||||
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.';
|
||||
}
|
||||
}, []);
|
||||
}
|
||||
Reference in New Issue
Block a user