feat: support device authorization (#3811)

This commit is contained in:
Alex Yang
2025-08-21 14:59:31 -07:00
committed by GitHub
parent 2edb2d6816
commit 5ded0904d4
28 changed files with 3150 additions and 74 deletions

View File

@@ -17,7 +17,9 @@ import { Loader2 } from "lucide-react";
import { signIn } from "@/lib/auth-client";
import Link from "next/link";
import { cn } from "@/lib/utils";
import { useRouter } from "next/navigation";
import { useRouter, useSearchParams } from "next/navigation";
import { toast } from "sonner";
import { getCallbackURL } from "@/lib/shared";
export default function SignIn() {
const [email, setEmail] = useState("");
@@ -25,6 +27,7 @@ export default function SignIn() {
const [loading, startTransition] = useTransition();
const [rememberMe, setRememberMe] = useState(false);
const router = useRouter();
const params = useSearchParams();
return (
<Card className="max-w-md rounded-none">
@@ -88,7 +91,8 @@ export default function SignIn() {
{ email, password, rememberMe },
{
onSuccess(context) {
router.push("/dashboard");
toast.success("Successfully signed in");
router.push(getCallbackURL(params));
},
},
);