core/components/Login.tsx
SKINMAKER 606f3cbc82
deps: update next.js to 13 (#627)
* 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
2023-09-28 23:22:46 +09:00

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