Merged in fix/SW-3578-user-is-forced-to-login- (pull request #3044)
fix(SW-3578): Fixed session issue when sas session expires * fix(SW-3578): Fixed session issue when sas session expires * base socialLogin auto-features on validSession and being linked * remove unused object * remove 'import server-only' for isValidSession() since it's only using passed data * remove isValidClientSession() Approved-by: Joakim Jäderberg Approved-by: Anton Gunnarsson
This commit is contained in:
committed by
Joakim Jäderberg
parent
15a2da333d
commit
1c7f72e95d
@@ -5,15 +5,15 @@ import { useSession } from "next-auth/react"
|
||||
|
||||
import { logoutSafely } from "@scandic-hotels/common/constants/routes/handleAuth"
|
||||
import { trpc } from "@scandic-hotels/trpc/client"
|
||||
import { isValidSession } from "@scandic-hotels/trpc/utils/session"
|
||||
|
||||
import { userNotFound } from "@/constants/routes/errorPages"
|
||||
|
||||
import useLang from "@/hooks/useLang"
|
||||
import { isValidClientSession } from "@/utils/clientSession"
|
||||
|
||||
export function UserExists() {
|
||||
const { data: session } = useSession()
|
||||
const isUserLoggedIn = isValidClientSession(session)
|
||||
const isUserLoggedIn = isValidSession(session)
|
||||
const lang = useLang()
|
||||
|
||||
const { isLoading: isLoadingUser, error } = trpc.user.get.useQuery(
|
||||
|
||||
Reference in New Issue
Block a user