add TRUSTED_AUTH_HEADER for auth forwarding (#399)

This commit is contained in:
henrygd
2025-09-10 21:26:59 -04:00
parent 07491108cd
commit e601a0d564
3 changed files with 110 additions and 0 deletions

View File

@@ -74,6 +74,19 @@ const Layout = () => {
document.documentElement.dir = direction
}, [direction])
// biome-ignore lint/correctness/useExhaustiveDependencies: only run on mount
useEffect(() => {
// refresh auth if not authenticated (required for trusted auth header)
if (!authenticated) {
pb.collection("users")
.authRefresh()
.then((res) => {
pb.authStore.save(res.token, res.record)
$authenticated.set(!!pb.authStore.isValid)
})
}
}, [])
return (
<DirectionProvider dir={direction}>
{!authenticated ? (