mirror of
https://github.com/sourcebot-dev/sourcebot.git
synced 2025-12-12 12:25:22 +00:00
improved fix
This commit is contained in:
parent
2111a77a5c
commit
331a41888e
2 changed files with 14 additions and 9 deletions
|
|
@ -13,13 +13,14 @@ import googleLogo from "@/public/google.svg";
|
|||
import Image from "next/image";
|
||||
import { signIn } from "next-auth/react";
|
||||
import { useCallback, useMemo } from "react";
|
||||
import { useNonEmptyQueryParam } from "@/hooks/useNonEmptyQueryParam";
|
||||
import { verifyCredentialsRequestSchema } from "@/lib/schemas";
|
||||
|
||||
export const LoginForm = () => {
|
||||
const callbackUrl = useNonEmptyQueryParam("callbackUrl");
|
||||
const error = useNonEmptyQueryParam("error");
|
||||
interface LoginFormProps {
|
||||
callbackUrl?: string;
|
||||
error?: string;
|
||||
}
|
||||
|
||||
export const LoginForm = ({ callbackUrl, error }: LoginFormProps) => {
|
||||
const form = useForm<z.infer<typeof verifyCredentialsRequestSchema>>({
|
||||
resolver: zodResolver(verifyCredentialsRequestSchema),
|
||||
defaultValues: {
|
||||
|
|
|
|||
|
|
@ -1,12 +1,16 @@
|
|||
import { LoginForm } from "./components/loginForm";
|
||||
import { Suspense } from "react";
|
||||
|
||||
export default async function Login() {
|
||||
interface LoginProps {
|
||||
searchParams: {
|
||||
callbackUrl?: string;
|
||||
error?: string;
|
||||
}
|
||||
}
|
||||
|
||||
export default async function Login({ searchParams }: LoginProps) {
|
||||
return (
|
||||
<div className="flex flex-col justify-center items-center h-screen">
|
||||
<Suspense fallback={<div>Loading...</div>}>
|
||||
<LoginForm />
|
||||
</Suspense>
|
||||
<LoginForm callbackUrl={searchParams.callbackUrl} error={searchParams.error} />
|
||||
</div>
|
||||
)
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue