Revert "fix: temporarily disable auth"

This reverts commit 468f95b03f.
This commit is contained in:
shadcn 2022-11-03 12:06:12 +04:00
parent fc33828afc
commit 718ed3487f
3 changed files with 24 additions and 26 deletions

View file

@ -8,7 +8,7 @@ export default function LoginPage() {
<div className="flex h-screen w-screen flex-col items-center justify-center">
<Link
href="/"
className="absolute top-8 left-8 inline-flex items-center justify-center rounded-lg border border-transparent bg-transparent py-2 px-3 text-center text-sm font-medium text-slate-900 hover:border-slate-100 hover:bg-slate-100 focus:z-10 focus:outline-none focus:ring-4 focus:ring-slate-200"
className="absolute top-8 left-8 inline-flex items-center justify-center rounded-lg border border-transparent bg-transparent py-2 px-3 text-center text-sm font-medium text-slate-900 hover:border-slate-100 hover:bg-slate-100 focus:z-10 focus:outline-none focus:ring-4 focus:ring-slate-200 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-400 dark:hover:bg-slate-700 dark:hover:text-white dark:focus:ring-slate-700"
>
<>
<Icons.chevronLeft className="mr-2 h-4 w-4" />

View file

@ -8,7 +8,7 @@ export default function RegisterPage() {
<div className="grid h-screen w-screen grid-cols-2 flex-col items-center justify-center">
<Link
href="/login"
className="absolute top-8 right-8 inline-flex items-center justify-center rounded-lg border border-transparent bg-transparent py-2 px-3 text-center text-sm font-medium text-slate-900 hover:border-slate-100 hover:bg-slate-100 focus:z-10 focus:outline-none focus:ring-4 focus:ring-slate-200"
className="absolute top-8 right-8 inline-flex items-center justify-center rounded-lg border border-transparent bg-transparent py-2 px-3 text-center text-sm font-medium text-slate-900 hover:border-slate-100 hover:bg-slate-100 focus:z-10 focus:outline-none focus:ring-4 focus:ring-slate-200 dark:border-slate-600 dark:bg-slate-800 dark:text-slate-400 dark:hover:bg-slate-700 dark:hover:text-white dark:focus:ring-slate-700"
>
Login
</Link>

View file

@ -26,30 +26,29 @@ export function UserAuthForm({ className, ...props }: UserAuthFormProps) {
const [isLoading, setIsLoading] = React.useState<boolean>(false)
async function onSubmit(data: FormData) {
return toast({
message:
"I've temporarily disabled authentication until I figure out a deployment issue.",
type: "error",
setIsLoading(true)
const signInResult = await signIn("email", {
email: data.email.toLowerCase(),
redirect: false,
callbackUrl: `${window.location.origin}/dashboard`,
})
setIsLoading(false)
if (!signInResult?.ok) {
return toast({
title: "Something went wrong.",
message: "Your post was not saved. Please try again.",
type: "error",
})
}
return toast({
title: "Check your email",
message: "We sent you a login link. Be sure to check your spam too.",
type: "success",
})
// setIsLoading(true)
// const signInResult = await signIn("email", {
// email: data.email.toLowerCase(),
// redirect: false,
// callbackUrl: `${window.location.origin}/dashboard`,
// })
// setIsLoading(false)
// if (!signInResult?.ok) {
// return toast({
// title: "Something went wrong.",
// message: "Your post was not saved. Please try again.",
// type: "error",
// })
// }
// return toast({
// title: "Check your email",
// message: "We sent you a login link. Be sure to check your spam too.",
// type: "success",
// })
}
return (
@ -97,7 +96,6 @@ export function UserAuthForm({ className, ...props }: UserAuthFormProps) {
<button
type="button"
className="inline-flex w-full items-center justify-center rounded-lg border bg-white px-5 py-2.5 text-center text-sm font-medium text-black hover:bg-slate-100 focus:outline-none focus:ring-4 focus:ring-[#24292F]/50 dark:hover:bg-[#050708]/30 dark:focus:ring-slate-500"
disabled={true}
onClick={() => signIn("github")}
>
<svg