mirror of
https://github.com/maziggy/bambuddy.git
synced 2026-10-20 17:50:12 +02:00
Fix created admin users not seeing settings button in sidebar (#503)
The sidebar hid Settings based on hardcoded role === 'user' instead of the settings:read permission, and login set user state directly from the response instead of re-fetching full auth status with permissions.
This commit is contained in:
@@ -95,7 +95,7 @@ export function AuthProvider({ children }: { children: React.ReactNode }) {
|
||||
const login = async (username: string, password: string) => {
|
||||
const response = await api.login({ username, password });
|
||||
setAuthToken(response.access_token);
|
||||
setUser(response.user);
|
||||
await checkAuthStatus();
|
||||
};
|
||||
|
||||
const logout = () => {
|
||||
|
||||
Reference in New Issue
Block a user