Skip to content

Commit 54dc104

Browse files
committed
Auth: login page added
1 parent b8b57a5 commit 54dc104

File tree

1 file changed

+55
-0
lines changed

1 file changed

+55
-0
lines changed

app/auth/page.tsx

Lines changed: 55 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
"use client"
2+
import * as React from "react"
3+
4+
import { GoogleFill, XFill } from "akar-icons"
5+
6+
import { authClient } from "@/lib/auth-client"
7+
8+
const initiateAuth = (provider: string) => {
9+
authClient.signIn.social({
10+
provider: provider,
11+
callbackURL: "/admin/",
12+
})
13+
}
14+
15+
const AuthPage: React.FC = () => {
16+
return (
17+
<main>
18+
<section className="grid place-content-center relative h-dvh">
19+
<div className="flex flex-col gap-4">
20+
<button
21+
onClick={() => initiateAuth("google")}
22+
className="border-dashed w-full px-3 py-2 text-sm cursor-pointer flex gap-2 items-center transition-colors bg-zinc-800 hover:bg-zinc-700 focus:bg-zinc-950 text-zinc-200"
23+
>
24+
<GoogleFill size={16} />
25+
Continue with Google
26+
</button>
27+
<button
28+
onClick={() => initiateAuth("apple")}
29+
className="border-dashed w-full px-3 py-2 text-sm cursor-pointer flex gap-2 items-center transition-colors bg-zinc-800 hover:bg-zinc-700 focus:bg-zinc-950 text-zinc-200"
30+
>
31+
<svg
32+
xmlns="http://www.w3.org/2000/svg"
33+
width={16}
34+
height={16}
35+
viewBox="0 0 814 1000"
36+
fill="currentColor"
37+
>
38+
<path d="M788.1 340.9c-5.8 4.5-108.2 62.2-108.2 190.5 0 148.4 130.3 200.9 134.2 202.2-.6 3.2-20.7 71.9-68.7 141.9-42.8 61.6-87.5 123.1-155.5 123.1s-85.5-39.5-164-39.5c-76.5 0-103.7 40.8-165.9 40.8s-105.6-57-155.5-127C46.7 790.7 0 663 0 541.8c0-194.4 126.4-297.5 250.8-297.5 66.1 0 121.2 43.4 162.7 43.4 39.5 0 101.1-46 176.3-46 28.5 0 130.9 2.6 198.3 99.2zm-234-181.5c31.1-36.9 53.1-88.1 53.1-139.3 0-7.1-.6-14.3-1.9-20.1-50.6 1.9-110.8 33.7-147.1 75.8-28.5 32.4-55.1 83.6-55.1 135.5 0 7.8 1.3 15.6 1.9 18.1 3.2.6 8.4 1.3 13.6 1.3 45.4 0 102.5-30.4 135.5-71.3z" />
39+
</svg>
40+
Continue with Apple
41+
</button>
42+
<button
43+
onClick={() => initiateAuth("twitter")}
44+
className="border-dashed w-full px-3 py-2 text-sm cursor-pointer flex gap-2 items-center transition-colors bg-zinc-800 hover:bg-zinc-700 focus:bg-zinc-950 text-zinc-200"
45+
>
46+
<XFill size={16} />
47+
Continue with Twitter
48+
</button>
49+
</div>
50+
</section>
51+
</main>
52+
)
53+
}
54+
55+
export default AuthPage

0 commit comments

Comments
 (0)