|
|
@@ -255,7 +255,6 @@
|
|
|
|
|
|
<div id="userSection" class="user-info">
|
|
|
<div class="user-details">
|
|
|
- <h3>Welcome!</h3>
|
|
|
<p><strong>Username:</strong> <span id="currentUsername"></span></p>
|
|
|
<p><strong>User ID:</strong> <span id="currentUserId"></span></p>
|
|
|
<p><strong>Roles:</strong> <span id="currentRoles"></span></p>
|
|
|
@@ -403,13 +402,18 @@
|
|
|
document.getElementById('userSection').classList.add('active');
|
|
|
|
|
|
document.getElementById('currentUsername').textContent = currentUser.username;
|
|
|
- document.getElementById('currentUserId').textContent = currentUser.id;
|
|
|
+ document.getElementById('currentUserId').textContent = maskUserId(currentUser.id);
|
|
|
document.getElementById('currentRoles').textContent = currentUser.roles.join(', ');
|
|
|
|
|
|
const expirationDate = new Date(currentUser.expirationDate);
|
|
|
document.getElementById('tokenExpiration').textContent = expirationDate.toLocaleString();
|
|
|
}
|
|
|
|
|
|
+ function maskUserId(id) {
|
|
|
+ const parts = id.split("-");
|
|
|
+ return parts[0] + "-****-" + parts[4];
|
|
|
+ }
|
|
|
+
|
|
|
function logout() {
|
|
|
localStorage.removeItem('authToken');
|
|
|
localStorage.removeItem('userData');
|