Handle 401 Error During Role Status Fetch in useActiveRole Composable
This commit is contained in:
@@ -56,6 +56,13 @@ export function useActiveRole() {
|
|||||||
|
|
||||||
return data
|
return data
|
||||||
} catch (err: any) {
|
} catch (err: any) {
|
||||||
|
// 401 during session initialization is normal - watch() will retry successfully
|
||||||
|
if (err.statusCode === 401) {
|
||||||
|
console.debug('Role status fetch: Session not ready yet, will retry via watch()')
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
// Other errors are real problems
|
||||||
console.error('Failed to fetch role status:', err)
|
console.error('Failed to fetch role status:', err)
|
||||||
error.value = 'Fehler beim Laden der Rollen'
|
error.value = 'Fehler beim Laden der Rollen'
|
||||||
throw err
|
throw err
|
||||||
|
|||||||
Reference in New Issue
Block a user