-
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Co-authored-by: Felipe Torres <[email protected]> Co-authored-by: Felipe Torres (fforres) <[email protected]>
- Loading branch information
1 parent
a35f415
commit 8ff3c6d
Showing
23 changed files
with
937 additions
and
373 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,4 +1,5 @@ | ||
NEXT_PUBLIC_JSCL_API_URL='https://api.jsconf.dev/graphql' | ||
NEXT_PUBLIC_TOKEN_STORAGE_KEY='HS:token_storage_key' | ||
NEXT_PUBLIC_CLERK_PUBLISHABLE_KEY='pk_test_ZnVua3ktZ3JpZmZvbi04NC5jbGVyay5hY2NvdW50cy5kZXYk' | ||
NEXT_PUBLIC_GOOGLE_MAPS_KEY='your_google_maps_key_here' | ||
NEXT_PUBLIC_SUPABASE_URL='your_supabase_url' | ||
NEXT_PUBLIC_SUPABASE_ANON_KEY='your_supabase_key' |
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
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,75 @@ | ||
"use client"; | ||
|
||
import { NextPage } from "next"; | ||
|
||
import { redirect } from "next/navigation"; | ||
import { useEffect, useState } from "react"; | ||
import { Auth } from "@supabase/auth-ui-react"; | ||
import { ThemeSupa } from "@supabase/auth-ui-shared"; | ||
import { supabaseClient } from "@/utils/supabase/client"; | ||
import { useTheme } from "next-themes"; | ||
import { useIsLoggedIn } from "@/utils/supabase/AuthProvider"; | ||
|
||
const AuthPage: NextPage = () => { | ||
const { resolvedTheme } = useTheme(); | ||
const [url, setUrl] = useState<string | undefined>(); | ||
useEffect(() => { | ||
const url = new URL(window.location.href); | ||
url.pathname = "/"; | ||
url.hash = ""; | ||
setUrl(url.toString()); | ||
}, []); | ||
|
||
const isLoggedIn = useIsLoggedIn(); | ||
if (isLoggedIn) { | ||
redirect("/"); | ||
} | ||
|
||
return ( | ||
<div className="min-h-[calc(100dvh-57px)] w-full bg-muted px-4 pt-8"> | ||
<div className="m-auto flex w-full max-w-lg shrink-0 flex-col gap-4 rounded-2xl bg-background p-10 shadow-xl"> | ||
<div> | ||
<h1 className="text-left text-2xl font-bold">Regístrate.</h1> | ||
<p className="text-left text-sm text-muted-foreground"> | ||
Mantente al tanto de las novedades de JavaScript Chile. | ||
</p> | ||
</div> | ||
|
||
<Auth | ||
providers={["github", "twitter"]} | ||
supabaseClient={supabaseClient} | ||
socialLayout="horizontal" | ||
showLinks={false} | ||
view="magic_link" | ||
redirectTo={url} | ||
localization={{ | ||
variables: { | ||
magic_link: { | ||
email_input_label: "Correo electrónico", | ||
email_input_placeholder: "Ingresa tu correo electrónico", | ||
button_label: "Enviar enlace mágico ✨", | ||
confirmation_text: "Revisa tu correo electrónico", | ||
empty_email_address: "Debes ingresar un correo electrónico", | ||
loading_button_label: "Enviando...", | ||
}, | ||
}, | ||
}} | ||
appearance={{ | ||
theme: ThemeSupa, | ||
variables: { | ||
default: { | ||
colors: { | ||
brand: "#000", | ||
brandAccent: "#2a2a2a", | ||
}, | ||
}, | ||
}, | ||
}} | ||
theme={resolvedTheme} | ||
/> | ||
</div> | ||
</div> | ||
); | ||
}; | ||
|
||
export default AuthPage; |
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
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
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
Oops, something went wrong.