mirror of
https://github.com/fankes/beszel.git
synced 2025-10-19 17:59:28 +08:00
refresh auth status if no systems are found
This commit is contained in:
@@ -34,16 +34,27 @@ const verifyAuth = () => {
|
|||||||
.authRefresh()
|
.authRefresh()
|
||||||
.catch(() => {
|
.catch(() => {
|
||||||
pb.authStore.clear()
|
pb.authStore.clear()
|
||||||
|
toast({
|
||||||
|
title: 'Failed to authenticate',
|
||||||
|
description: 'Please log in again',
|
||||||
|
variant: 'destructive',
|
||||||
|
})
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
export const updateSystemList = async () => {
|
export const updateSystemList = async () => {
|
||||||
try {
|
// try {
|
||||||
const records = await pb.collection<SystemRecord>('systems').getFullList({ sort: '+name' })
|
const records = await pb.collection<SystemRecord>('systems').getFullList({ sort: '+name' })
|
||||||
|
if (records.length) {
|
||||||
$systems.set(records)
|
$systems.set(records)
|
||||||
} catch (e) {
|
} else {
|
||||||
verifyAuth()
|
verifyAuth()
|
||||||
}
|
}
|
||||||
|
// }
|
||||||
|
// catch (e) {
|
||||||
|
// console.log('verifying auth error', e)
|
||||||
|
// verifyAuth()
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
|
|
||||||
export const updateAlerts = () => {
|
export const updateAlerts = () => {
|
||||||
|
Reference in New Issue
Block a user