-
-
-
diff --git a/client/js/banned.js b/client/js/banned.js
index 040f98a..dd349a3 100644
--- a/client/js/banned.js
+++ b/client/js/banned.js
@@ -2,41 +2,55 @@ $(document).ready(function () {
const token = localStorage.getItem('token');
const isBanned = localStorage.getItem('isBanned') === 'true';
const banReason = localStorage.getItem('banReason');
+ const banDate = localStorage.getItem('banDate');
if (isBanned && banReason) {
- displayBanReason(banReason);
+ displayBanInfo(banReason, banDate);
} else if (token) {
- checkBanStatus(token);
+ checkBanStatus(token);
} else {
- window.location.href = '/login';
+ window.location.href = '/login';
}
});
-function displayBanReason(reason) {
- $('#ban-reason').text(`Reason: ${reason || 'No reason provided'}`);
- $('#loading').hide();
- $('#content').show();
+function displayBanInfo(reason, date) {
+ $('#ban-reason').text(reason || 'No reason provided');
+ $('#ban-date').text(formatDate(date) || 'Unknown');
+ $('body').removeClass('hidden');
}
function checkBanStatus(token) {
$.ajax({
- url: '/api/auth/check-ban',
- method: 'GET',
- headers: {
- Authorization: `Bearer ${token}`,
- },
- success: function (response) {
- if (response.isBanned) {
- localStorage.setItem('isBanned', 'true');
- localStorage.setItem('banReason', response.banReason);
- displayBanReason(response.banReason);
- } else {
- window.location.href = '/';
- }
- },
- error: function (xhr) {
- console.error('Error checking ban status:', xhr.responseText);
- window.location.href = '/login';
- },
+ url: '/api/auth/check-ban',
+ method: 'GET',
+ headers: {
+ Authorization: `Bearer ${token}`,
+ },
+ success: function (response) {
+ if (response.isBanned) {
+ localStorage.setItem('isBanned', 'true');
+ localStorage.setItem('banReason', response.banReason);
+ localStorage.setItem('banDate', response.banDate);
+ displayBanInfo(response.banReason, response.banDate);
+ } else {
+ window.location.href = '/';
+ }
+ },
+ error: function (xhr) {
+ console.error('Error checking ban status:', xhr.responseText);
+ window.location.href = '/login';
+ },
+ });
+}
+
+function formatDate(dateString) {
+ if (!dateString) return null;
+ const date = new Date(dateString);
+ return date.toLocaleDateString('en-US', {
+ year: 'numeric',
+ month: 'long',
+ day: 'numeric',
+ hour: '2-digit',
+ minute: '2-digit'
});
}
\ No newline at end of file
Your account has been banned
- --
- If you believe this is an error, please contact support. -
+
+
+
+
+
+
+
+ + Account Banned +
+
+
+
+
+
+ Your account has been suspended
+ ++
+ If you believe this is an error, please contact our support + team. +
+ Contact Support +