Skip to content

armgit / dashy

Public Imported from GitHub
0

πŸš€ A self-hostable personal dashboard built for you. Includes status-checking, widgets, themes, icon packs, a UI editor and tons more!

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

kristian9c15314af855
diff --git a/src/utils/Auth.js b/src/utils/Auth.js
index df9f3478..f257c440 100644
--- a/src/utils/Auth.js
+++ b/src/utils/Auth.js
@@ -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;
}
});