with built in auth, if user adds a capital letter to username they can see all items.

This commit is contained in:
kristian 2022-09-05 20:40:56 -07:00
parent 8d300d42a4
commit 9c15314af8
1 changed files with 2 additions and 2 deletions

View File

@ -150,7 +150,7 @@ export const getCurrentUser = () => {
let foundUserObject = false; // Value to return
getUsers().forEach((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;
};
@ -180,7 +180,7 @@ export const isUserAdmin = () => {
const currentUser = localStorage[localStorageKeys.USERNAME];
let isAdmin = false;
users.forEach((user) => {
if (user.user === currentUser) {
if (user.user.toLowerCase() === currentUser.toLowerCase()) {
if (user.type === 'admin') isAdmin = true;
}
});