mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 09:49:28 +08:00
add TRUSTED_AUTH_HEADER for auth forwarding (#399)
This commit is contained in:
@@ -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 ? (
|
||||
|
Reference in New Issue
Block a user