-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathpage.tsx
More file actions
42 lines (39 loc) · 1.35 KB
/
page.tsx
File metadata and controls
42 lines (39 loc) · 1.35 KB
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
34
35
36
37
38
39
40
41
42
import RegisterClientPage from "./register-page";
import { getSettingValue } from "~/lib/utils/settings";
export default async function RegisterPage({
isFirstUser = false,
}: {
isFirstUser?: boolean;
}) {
const allowRegistration = await getSettingValue("auth.allowRegistration");
if (!allowRegistration) {
return (
<div className="bg-background-paper flex h-screen flex-col items-center justify-center px-4 py-12 sm:px-6 lg:px-8">
<div className="w-full max-w-md space-y-8">
<div>
<h2 className="mt-6 text-center text-3xl font-bold tracking-tight">
Registration is not allowed
</h2>
</div>
</div>
</div>
);
}
return (
<div className="bg-background-paper flex h-screen flex-col items-center justify-center px-4 py-12 sm:px-6 lg:px-8">
<div className="w-full max-w-md space-y-8">
<div>
<h2 className="mt-6 text-center text-3xl font-bold tracking-tight">
{isFirstUser ? "Create Admin Account" : "Create Account"}
</h2>
{isFirstUser && (
<p className="text-text-secondary mt-2 text-center text-sm">
This will be the first user and will have admin privileges
</p>
)}
</div>
</div>
<RegisterClientPage isFirstUser={isFirstUser} />
</div>
);
}