Skip to content

Commit

Permalink
Refactor LoginChecker component to remove console.log statements and …
Browse files Browse the repository at this point in the history
…improve user permission handling and redirection logic
  • Loading branch information
Adammatthiesen committed Dec 22, 2024
1 parent e09e33b commit 4a4bfe3
Showing 1 changed file with 0 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -31,20 +31,15 @@ const isAuthorized = await verifyUserPermissionLevel(user, requiredPermission);
const redirectProfile = this.dataset.redirect_profile;
const redirectLogin = this.dataset.redirect_login;

console.debug('Checking user permissions and login status');

if (isLoggedIn === 'false') {
console.debug('redirecting to login');
window.location.href = redirectLogin;
}

if (window.location.pathname === redirectProfile) {
console.debug('User is on profile page');
return;
}

if (authorized === 'false') {
console.debug('redirecting to profile');
window.location.href = redirectProfile;
}
}
Expand Down

0 comments on commit 4a4bfe3

Please sign in to comment.