Skip to content

Commit 84fe2b7

Browse files
committed
fix: response camelCaseKeys
- Removed the server-side check for window existence in usePageRedirect hook, streamlining the redirect logic. - Ensured that tenant slug resolution remains intact for client-side operations. Signed-off-by: Innei <tukon479@gmail.com>
1 parent d151122 commit 84fe2b7

File tree

2 files changed

+2
-6
lines changed

2 files changed

+2
-6
lines changed

be/apps/dashboard/src/hooks/usePageRedirect.ts

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -170,10 +170,6 @@ export function usePageRedirect() {
170170
return
171171
}
172172

173-
if (typeof window === 'undefined') {
174-
return
175-
}
176-
177173
const currentSlug = getTenantSlugFromHost(window.location.hostname)
178174
if (currentSlug && currentSlug === tenant.slug) {
179175
return

be/apps/dashboard/src/modules/auth/api/session.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { coreApi } from '~/lib/api-client'
2+
import { camelCaseKeys } from '~/lib/case'
23

34
import type { BetterAuthSession, BetterAuthUser } from '../types'
45

@@ -17,6 +18,5 @@ export type SessionResponse = {
1718
export const AUTH_SESSION_QUERY_KEY = ['auth', 'session'] as const
1819

1920
export async function fetchSession() {
20-
const session = await coreApi<SessionResponse>('/auth/session', { method: 'GET' })
21-
return session
21+
return camelCaseKeys<SessionResponse>(await coreApi<SessionResponse>('/auth/session', { method: 'GET' }))
2222
}

0 commit comments

Comments
 (0)