Updated local auth state storage

This commit is contained in:
Christopher Sanden
2026-03-11 17:07:34 +01:00
parent 3e81e46b1a
commit 05a9b4f023
2 changed files with 52 additions and 25 deletions

View File

@@ -1,5 +1,5 @@
import { AuthContext } from '@/hooks/use-auth-context'
import { supabase } from '@/libs/supabase'
import { hasSecureRefreshToken, supabase } from '@/libs/supabase'
import { PropsWithChildren, useEffect, useState } from 'react'
const buildClaims = (user?: { id: string; email?: string | null } | null) =>
@@ -26,6 +26,10 @@ export default function AuthProvider({ children }: PropsWithChildren) {
console.error('Error hydrating session:', error)
}
if (!session && await hasSecureRefreshToken()) {
console.warn('Found an encrypted Supabase refresh token backup, but fallback session recovery is not implemented.')
}
setClaims(buildClaims(session?.user))
setIsLoading(false)
}