-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
61 additions
and
38 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,42 +1,23 @@ | ||
"use client" | ||
import { cookies } from "next/headers" | ||
import { redirect } from "next/navigation" | ||
import { createServerComponentClient } from "@supabase/auth-helpers-nextjs" | ||
import { Database } from "@/app/types/database" | ||
import AuthUI from "@/components/login/auth" | ||
|
||
import { ThemeSupa } from '@supabase/auth-ui-shared' | ||
import { Auth } from "@supabase/auth-ui-react" | ||
import { motion } from 'framer-motion'; | ||
import SparklesCore from '@/components/landing/particles'; | ||
import { createClientComponentClient } from '@supabase/auth-helpers-nextjs'; | ||
export default async function User({ params }: { params: { id: string } }) { | ||
const { id } = params | ||
const supabase = createServerComponentClient<Database>({ cookies }) | ||
const { | ||
data: { session }, | ||
} = await supabase.auth.getSession() | ||
|
||
export default function Login() { | ||
const supabase = createClientComponentClient() | ||
|
||
if (session) { | ||
redirect("/") | ||
} | ||
return ( | ||
<div className="flex flex-col"> | ||
<div className="absolute top-0 h-full min-w-full overflow-hidden"> | ||
<SparklesCore | ||
id="tsparticlesfullpage" | ||
background="transparent" | ||
minSize={0.6} | ||
maxSize={1.4} | ||
particleDensity={30} | ||
className="size-full" | ||
particleColor="#FFFFFF" | ||
/> | ||
</div> | ||
<motion.div initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ duration: 0.3, delay: 1 }} className="absolute drop-shadow-2xl border border-white/10 top-[50%] left-[50%] max-h-full h-full md:h-auto md:max-h-[85vh] w-full md:w-[90vw] md:max-w-[450px] translate-x-[-50%] translate-y-[-50%] md:rounded-xl bg-neutral-800/40 p-[25px] focus:outline-none "> | ||
<div className='max-w-2xl max-md:py-24'> | ||
<Auth | ||
supabaseClient={supabase} | ||
providers={['discord', 'twitter', 'github']} | ||
redirectTo='http://applio.org/auth/callback' | ||
appearance={{ | ||
theme: ThemeSupa, }} | ||
theme='dark' | ||
socialLayout='vertical' | ||
showLinks | ||
onlyThirdPartyProviders | ||
/> | ||
</div> | ||
</motion.div> | ||
</div> | ||
); | ||
} | ||
<section> | ||
<AuthUI /> | ||
</section> | ||
) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
"use client" | ||
|
||
import { ThemeSupa } from '@supabase/auth-ui-shared' | ||
import { Auth } from "@supabase/auth-ui-react" | ||
import { motion } from 'framer-motion'; | ||
import SparklesCore from '@/components/landing/particles'; | ||
import { createClientComponentClient } from '@supabase/auth-helpers-nextjs'; | ||
|
||
export default function AuthUI() { | ||
const supabase = createClientComponentClient() | ||
|
||
return ( | ||
<div className="flex flex-col"> | ||
<div className="absolute top-0 h-full min-w-full overflow-hidden"> | ||
<SparklesCore | ||
id="tsparticlesfullpage" | ||
background="transparent" | ||
minSize={0.6} | ||
maxSize={1.4} | ||
particleDensity={30} | ||
className="size-full" | ||
particleColor="#FFFFFF" | ||
/> | ||
</div> | ||
<motion.div initial={{ opacity: 0 }} animate={{ opacity: 1 }} transition={{ duration: 0.3, delay: 1 }} className="absolute drop-shadow-2xl border border-white/10 top-[50%] left-[50%] max-h-full h-full md:h-auto md:max-h-[85vh] w-full md:w-[90vw] md:max-w-[450px] translate-x-[-50%] translate-y-[-50%] md:rounded-xl bg-neutral-800/40 p-[25px] focus:outline-none "> | ||
<div className='max-w-2xl max-md:py-24'> | ||
<Auth | ||
supabaseClient={supabase} | ||
providers={['discord', 'twitter', 'github']} | ||
redirectTo='http://applio.org/auth/callback' | ||
appearance={{ | ||
theme: ThemeSupa, }} | ||
theme='dark' | ||
socialLayout='vertical' | ||
showLinks | ||
onlyThirdPartyProviders | ||
/> | ||
</div> | ||
</motion.div> | ||
</div> | ||
); | ||
} |