mirror of
https://github.com/Monadical-SAS/reflector.git
synced 2025-12-21 04:39:06 +00:00
fix: token refresh locking (#613)
* fix: kv use tls explicit * fix: token refresh locking * remove logs * compile fix * compile fix --------- Co-authored-by: Igor Loskutov <igor.loskutoff@gmail.com>
This commit is contained in:
@@ -2,6 +2,7 @@ import { useAuth } from "./AuthProvider";
|
||||
|
||||
export const useUserName = (): string | null | undefined => {
|
||||
const auth = useAuth();
|
||||
if (auth.status !== "authenticated") return undefined;
|
||||
if (auth.status !== "authenticated" && auth.status !== "refreshing")
|
||||
return undefined;
|
||||
return auth.user?.name || null;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user