mirror of
https://github.com/Lissy93/dashy.git
synced 2025-12-07 09:07:23 +01:00
with built in auth, if user adds a capital letter to username they can see all items.
This commit is contained in:
parent
8d300d42a4
commit
9c15314af8
1 changed files with 2 additions and 2 deletions
|
|
@ -150,7 +150,7 @@ export const getCurrentUser = () => {
|
||||||
let foundUserObject = false; // Value to return
|
let foundUserObject = false; // Value to return
|
||||||
getUsers().forEach((user) => {
|
getUsers().forEach((user) => {
|
||||||
// If current logged-in user found, then return that user
|
// If current logged-in user found, then return that user
|
||||||
if (user.user === username) foundUserObject = user;
|
if (user.user.toLowerCase() === username.toLowerCase()) foundUserObject = user;
|
||||||
});
|
});
|
||||||
return foundUserObject;
|
return foundUserObject;
|
||||||
};
|
};
|
||||||
|
|
@ -180,7 +180,7 @@ export const isUserAdmin = () => {
|
||||||
const currentUser = localStorage[localStorageKeys.USERNAME];
|
const currentUser = localStorage[localStorageKeys.USERNAME];
|
||||||
let isAdmin = false;
|
let isAdmin = false;
|
||||||
users.forEach((user) => {
|
users.forEach((user) => {
|
||||||
if (user.user === currentUser) {
|
if (user.user.toLowerCase() === currentUser.toLowerCase()) {
|
||||||
if (user.type === 'admin') isAdmin = true;
|
if (user.type === 'admin') isAdmin = true;
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue