Skip to content

Commit 0a78d4b

Browse files
Fix/login loop 1.4 (#298)
* Avoid redirect loop * Update signin.tsx
1 parent f7a88b4 commit 0a78d4b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/pages/auth/signin.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -221,10 +221,10 @@ export const getServerSideProps: GetServerSideProps = async (context) => {
221221
const { callbackUrl } = context.query;
222222

223223
if (session) {
224+
const redirectUrl = env.DEFAULT_HOMEPAGE == '/home' ? '/balances' : env.DEFAULT_HOMEPAGE;
224225
return {
225226
redirect: {
226-
destination:
227-
callbackUrl && !Array.isArray(callbackUrl) ? callbackUrl : env.DEFAULT_HOMEPAGE,
227+
destination: callbackUrl && !Array.isArray(callbackUrl) ? callbackUrl : redirectUrl,
228228
permanent: false,
229229
},
230230
};

0 commit comments

Comments
 (0)