Lots of improvements
This commit is contained in:
parent
3853b5dce7
commit
b94cf17d75
33 changed files with 2587 additions and 1866 deletions
|
|
@ -126,8 +126,10 @@ export function useAuth() {
|
|||
const result = await pb.collection('users').authRefresh();
|
||||
setUser(recordToUser(result.record));
|
||||
} catch (err) {
|
||||
const msg = err instanceof Error ? err.message : 'Auth refresh failed';
|
||||
setError(msg);
|
||||
// Token is invalid/expired — clear auth state but don't set error,
|
||||
// since this is a background refresh, not a user-initiated action
|
||||
pb.authStore.clear();
|
||||
setUser(null);
|
||||
throw err;
|
||||
} finally {
|
||||
setLoading(false);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue