mirror of
https://github.com/koreanbots/core.git
synced 2025-12-15 14:10:22 +00:00
* deps: update next.js to 13 * chore: migrate to new Link component * chore: remove future option from next.config * chore: update react-select * chore: enable hideSourceMaps on sentry * chore: assert type as string * chore: make placeholder and value absolute * feat: set timeout for redirect * chore: ignore ts error * chore: add generics * chore: * chore: add ts comment * feat: use dnd-kit instead of react-sortable-hoc * fix: give absolute position to placeholder
17 lines
369 B
TypeScript
17 lines
369 B
TypeScript
import { useEffect } from 'react'
|
|
import { useRouter } from 'next/router'
|
|
|
|
import { redirectTo } from '@utils/Tools'
|
|
|
|
const Login: React.FC<React.PropsWithChildren> = ({ children }) => {
|
|
const router = useRouter()
|
|
useEffect(() => {
|
|
localStorage.redirectTo = window.location.href
|
|
redirectTo(router, 'login')
|
|
})
|
|
return <>
|
|
{children}
|
|
</>
|
|
}
|
|
|
|
export default Login |