Skip to content

Commit

Permalink
🔀 Merge pull request #887 from Cereal916/master
Browse files Browse the repository at this point in the history
with built in auth, if user adds a capital letter to username they ca…
  • Loading branch information
Lissy93 authored Sep 10, 2022
2 parents 1046b44 + 9c15314 commit e2fb5fc
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/Auth.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};
Expand Down Expand Up @@ -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;
}
});
Expand Down

0 comments on commit e2fb5fc

Please sign in to comment.