mirror of
https://github.com/hamster1963/nezha-dash.git
synced 2025-04-24 21:10:45 +08:00
fix: redirect
This commit is contained in:
parent
27d61f6174
commit
5533ef5fb9
@ -1,15 +1,19 @@
|
||||
import Footer from "@/app/[locale]/(main)/footer"
|
||||
import Header from "@/app/[locale]/(main)/header"
|
||||
import { signIn } from "@/auth"
|
||||
import { useLocale } from "next-intl"
|
||||
import { redirect } from "next/navigation"
|
||||
|
||||
export function SignIn() {
|
||||
const locale = useLocale()
|
||||
|
||||
|
||||
async function handleSubmit(formData: FormData) {
|
||||
'use server'
|
||||
try {
|
||||
await signIn("credentials", formData)
|
||||
} catch (error) {
|
||||
redirect('/')
|
||||
redirect(`/${locale}`)
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user