-
Notifications
You must be signed in to change notification settings - Fork 38
Expand file tree
/
Copy pathpage.tsx
More file actions
33 lines (29 loc) · 829 Bytes
/
page.tsx
File metadata and controls
33 lines (29 loc) · 829 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
"use client";
import {
CallbackPage,
DEFAULT_REDIRECT_URI_PATH,
DEFAULT_SANDBOX_CLIENT_ID,
} from "@imtbl/auth-next-client";
export default function AuthCallback() {
// Build redirectUri only when window exists to avoid prerender error
const config =
typeof window !== "undefined"
? {
clientId: DEFAULT_SANDBOX_CLIENT_ID,
redirectUri: `${window.location.origin}${DEFAULT_REDIRECT_URI_PATH}`,
}
: null;
if (!config) {
return (
<div style={{ padding: "2rem", textAlign: "center" }}>
<h1>Processing authentication...</h1>
</div>
);
}
return (
<div style={{ padding: "2rem", textAlign: "center" }}>
<h1>Processing authentication...</h1>
<CallbackPage config={config} redirectTo="/connect-with-auth-next" />
</div>
);
}