feat: implement unified login flow with LoginButton and contextual LoginDialog for unauthenticated form access
This commit is contained in:
+9
-1
@@ -17,7 +17,7 @@ import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent,
|
||||
import { toast } from "sonner";
|
||||
import { submitForm, deleteOwnSubmission } from "@/app/actions/submissions";
|
||||
import { Loader2, LogOut } from "lucide-react";
|
||||
import { signOut } from "next-auth/react";
|
||||
import { signIn, signOut } from "next-auth/react";
|
||||
import Image from "next/image";
|
||||
import { z } from "zod";
|
||||
import { useForm, Controller } from "react-hook-form";
|
||||
@@ -49,6 +49,14 @@ export function FormLayoutClient({
|
||||
);
|
||||
}
|
||||
|
||||
export function LoginButton() {
|
||||
return (
|
||||
<Button variant="outline" size="sm" onClick={() => signIn("discord", { callbackUrl: window.location.href })}>
|
||||
Login
|
||||
</Button>
|
||||
);
|
||||
}
|
||||
|
||||
interface Question {
|
||||
id: string;
|
||||
formId: string;
|
||||
|
||||
Reference in New Issue
Block a user