fix: check client side for redirects

This commit is contained in:
skinmaker1345 2024-10-26 13:50:57 +09:00
parent 60f8f08707
commit 47a8ca20cf
2 changed files with 2 additions and 2 deletions

View File

@ -52,7 +52,7 @@ const BotApplication: NextPage<BotApplicationProps> = ({ user, spec, bot, theme,
return res
}
if (!user) {
if (!user && typeof window !== 'undefined') {
localStorage.redirectTo = window.location.href
redirectTo(router, 'login')
return

View File

@ -57,7 +57,7 @@ const ServerApplication: NextPage<ServerApplicationProps> = ({
return res
}
if (!user) {
if (!user && typeof window !== 'undefined') {
localStorage.redirectTo = window.location.href
redirectTo(router, 'login')
return