summaryrefslogtreecommitdiff
path: root/src/app/(auth)/login
diff options
context:
space:
mode:
authorBertrand Yuan <bert.yuan@outlook.com>2025-12-16 00:12:49 +0800
committerBertrand Yuan <bert.yuan@outlook.com>2025-12-16 00:12:49 +0800
commit02ae938c238c9d18448d17a8ec92c0edd8c17463 (patch)
treedcd6a30505adb52522b20af2c0ac27f713403f10 /src/app/(auth)/login
parent48b07bc308a35734a6a7a305c8fdccbfa47de7d8 (diff)
feat(back-end): introduce payload
Payload is the next.js Headless CMS and App Framework, I would like to pick it up and modify it as it is MIT licensed. Many features in Payload is not applicable for our project. So, I modify it so that it is light and clear.
Diffstat (limited to 'src/app/(auth)/login')
-rw-r--r--src/app/(auth)/login/page.tsx116
1 files changed, 0 insertions, 116 deletions
diff --git a/src/app/(auth)/login/page.tsx b/src/app/(auth)/login/page.tsx
deleted file mode 100644
index 2469097..0000000
--- a/src/app/(auth)/login/page.tsx
+++ /dev/null
@@ -1,116 +0,0 @@
-'use client';
-
-import { baseOptions, linkItems } from '@/app/layout.config';
-import { Icons } from '@/components/icons/icons';
-import { Header } from '@/components/sections/header';
-import { Button } from '@/components/ui/button';
-import {
- Card,
- CardContent,
- CardDescription,
- CardHeader,
- CardTitle,
-} from '@/components/ui/card';
-import { signIn } from '@/lib/auth-client';
-import { cn } from '@/lib/utils';
-import { HomeLayout } from 'fumadocs-ui/layouts/home';
-import { getLinks } from 'fumadocs-ui/layouts/shared';
-import { PlusIcon } from 'lucide-react';
-
-const Cross = () => (
- <div className='relative h-6 w-6'>
- <div className='-translate-x-1/2 -translate-y-1/2 absolute top-1/2 left-1/2 bg-background'>
- <PlusIcon size={20} className='text-border/70 dark:text-border' />
- </div>
- </div>
-);
-
-function SignInCard() {
- return (
- <Card className='relative w-full max-w-xl rounded-none border border-border/70 border-dashed shadow-none dark:border-border'>
- <div className='-top-3 -left-3 absolute z-10 hidden h-6 sm:block'>
- <Cross />
- </div>
- <div className='-top-3 -right-3 -translate-x-px absolute z-10 hidden h-6 sm:block'>
- <Cross />
- </div>
- <CardHeader>
- <CardTitle className='text-lg md:text-xl'>Sign In</CardTitle>
- <CardDescription className='text-xs md:text-sm'>
- Sign in with your account
- </CardDescription>
- </CardHeader>
- <CardContent>
- <div className='grid gap-4'>
- <div
- className={cn(
- 'flex w-full items-center gap-2',
- 'flex-col justify-between',
- )}
- >
- <Button
- variant='outline'
- className={cn(
- 'w-full gap-2 rounded-none border border-border/70 border-dashed dark:border-border',
- )}
- onClick={async () => {
- await signIn.social({
- provider: 'google',
- callbackURL: '/',
- });
- }}
- >
- <Icons.google />
- Sign in with Google
- </Button>
- <Button
- variant='outline'
- className={cn(
- 'w-full gap-2 rounded-none border border-border/70 border-dashed dark:border-border',
- )}
- onClick={async () => {
- await signIn.social({
- provider: 'github',
- callbackURL: '/',
- });
- }}
- >
- <Icons.gitHub />
- Sign in with Github
- </Button>
- </div>
- </div>
- </CardContent>
- <div className='-bottom-3 -left-3 absolute z-10 hidden h-6 sm:block'>
- <Cross />
- </div>
- <div className='-bottom-3 -right-3 -translate-x-px absolute z-10 hidden h-6 sm:block'>
- <Cross />
- </div>
- </Card>
- );
-}
-
-export default function LoginPage() {
- return (
- <HomeLayout
- {...baseOptions}
- links={linkItems}
- nav={{
- component: (
- <Header
- finalLinks={getLinks(linkItems, baseOptions.githubUrl)}
- {...baseOptions}
- />
- ),
- }}
- className='border-grid pt-0'
- >
- <main className='flex flex-1 px-4 sm:px-8 md:px-12 lg:px-16 2xl:px-24'>
- <div className='container flex min-h-full flex-1 items-center justify-center border-border/70 border-x border-b border-dashed dark:border-border'>
- <SignInCard />
- </div>
- </main>
- </HomeLayout>
- );
-}