Skip to content

Commit 47a8ca2

Browse files
committed
fix: check client side for redirects
1 parent 60f8f08 commit 47a8ca2

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

pages/developers/applications/bots/[id].tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,7 @@ const BotApplication: NextPage<BotApplicationProps> = ({ user, spec, bot, theme,
5252
return res
5353
}
5454

55-
if (!user) {
55+
if (!user && typeof window !== 'undefined') {
5656
localStorage.redirectTo = window.location.href
5757
redirectTo(router, 'login')
5858
return

pages/developers/applications/servers/[id].tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ const ServerApplication: NextPage<ServerApplicationProps> = ({
5757
return res
5858
}
5959

60-
if (!user) {
60+
if (!user && typeof window !== 'undefined') {
6161
localStorage.redirectTo = window.location.href
6262
redirectTo(router, 'login')
6363
return

0 commit comments

Comments
 (0)