api-client/packages/hoppscotch-common/src/helpers/appLoginGate.ts

15 lines
321 B
TypeScript
Raw Normal View History

2026-05-06 07:22:55 +00:00
type KernelMode = "web" | "desktop"
export type LoginGateState = {
platform: KernelMode
isAuthInitComplete: boolean
currentUser: unknown | null
}
export function shouldBlockAppForLogin(state: LoginGateState) {
return (
state.platform === "web" &&
(!state.isAuthInitComplete || !state.currentUser)
)
}