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