mirror of
https://github.com/LukeHagar/better-auth.git
synced 2025-12-09 20:27:44 +00:00
feat: support device authorization (#3811)
This commit is contained in:
@@ -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));
|
||||
},
|
||||
},
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user