mbkauthe 1.1.11 → 1.1.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/info.js +1 -1
- package/lib/main.js +6 -4
- package/package.json +1 -1
- package/views/loginmbkauthe.handlebars +28 -5
package/lib/info.js
CHANGED
|
@@ -20,7 +20,7 @@ router.get("/mbkauthe/login", (req, res) => {
|
|
|
20
20
|
layout: false,
|
|
21
21
|
customURL: mbkautheVar.loginRedirectURL || '/home',
|
|
22
22
|
userLoggedIn: !!req.session?.user,
|
|
23
|
-
|
|
23
|
+
username: req.session?.user?.username || ''
|
|
24
24
|
});
|
|
25
25
|
});
|
|
26
26
|
|
package/lib/main.js
CHANGED
|
@@ -18,6 +18,10 @@ const mbkautheVar = JSON.parse(process.env.mbkautheVar);
|
|
|
18
18
|
|
|
19
19
|
const router = express.Router();
|
|
20
20
|
|
|
21
|
+
router.use(express.json());
|
|
22
|
+
router.use(express.urlencoded({ extended: true }));
|
|
23
|
+
router.use(cookieParser());
|
|
24
|
+
|
|
21
25
|
router.use((req, res, next) => {
|
|
22
26
|
const origin = req.headers.origin;
|
|
23
27
|
if (origin && origin.endsWith(`.${mbkautheVar.DOMAIN}`)) {
|
|
@@ -28,10 +32,6 @@ router.use((req, res, next) => {
|
|
|
28
32
|
}
|
|
29
33
|
next();
|
|
30
34
|
});
|
|
31
|
-
router.use(mbkautheinfo);
|
|
32
|
-
router.use(express.json());
|
|
33
|
-
router.use(express.urlencoded({ extended: true }));
|
|
34
|
-
router.use(cookieParser());
|
|
35
35
|
|
|
36
36
|
const LoginLimit = rateLimit({
|
|
37
37
|
windowMs: 1 * 60 * 1000,
|
|
@@ -335,4 +335,6 @@ router.post("/mbkauthe/api/logout", async (req, res) => {
|
|
|
335
335
|
}
|
|
336
336
|
});
|
|
337
337
|
|
|
338
|
+
router.use(mbkautheinfo);
|
|
339
|
+
|
|
338
340
|
export default router;
|
package/package.json
CHANGED
|
@@ -228,12 +228,10 @@
|
|
|
228
228
|
cursor: pointer;
|
|
229
229
|
transition: var(--transition);
|
|
230
230
|
box-shadow: var(--shadow-sm);
|
|
231
|
-
margin-top: 1rem;
|
|
232
231
|
}
|
|
233
232
|
|
|
234
233
|
.btn-login:hover {
|
|
235
234
|
background: var(--primary-dark);
|
|
236
|
-
transform: translateY(-3px);
|
|
237
235
|
box-shadow: var(--shadow-md);
|
|
238
236
|
}
|
|
239
237
|
|
|
@@ -420,6 +418,20 @@
|
|
|
420
418
|
.remember-me label:hover {
|
|
421
419
|
color: var(--light);
|
|
422
420
|
}
|
|
421
|
+
|
|
422
|
+
.WarningboxInfo {
|
|
423
|
+
background: var(--dark-light);
|
|
424
|
+
border: 0.5px solid var(--warning);
|
|
425
|
+
border-left: 4px solid var(--warning);
|
|
426
|
+
padding: 0.75rem 1rem;
|
|
427
|
+
border-radius: var(--radius-sm);
|
|
428
|
+
color: var(--warning);
|
|
429
|
+
font-size: 0.9rem;
|
|
430
|
+
font-weight: 500;
|
|
431
|
+
margin-top: 1rem;
|
|
432
|
+
text-align: center;
|
|
433
|
+
box-shadow: var(--shadow-sm);
|
|
434
|
+
}
|
|
423
435
|
</style>
|
|
424
436
|
</head>
|
|
425
437
|
|
|
@@ -485,6 +497,14 @@
|
|
|
485
497
|
<span id="loginButtonText">Login</span>
|
|
486
498
|
</button>
|
|
487
499
|
|
|
500
|
+
{{#if userLoggedIn }}
|
|
501
|
+
<div class="WarningboxInfo">
|
|
502
|
+
You Are Already Logged In With username
|
|
503
|
+
<span class="username">"<span id="headerProfileUserName">{{username}}</span>"</span>. Go To
|
|
504
|
+
<a class="terms-link" href="/home">Home Page</a>
|
|
505
|
+
</div>
|
|
506
|
+
{{/if }}
|
|
507
|
+
|
|
488
508
|
<div class="login-links">
|
|
489
509
|
<a onclick="fpass()" class="login-link">Forgot Password?</a>
|
|
490
510
|
<a href="https://www.mbktechstudio.com/Support" target="_blank" class="login-link">Need Help?</a>
|
|
@@ -492,9 +512,9 @@
|
|
|
492
512
|
|
|
493
513
|
<p class="terms-info">
|
|
494
514
|
By logging in, you agree to our
|
|
495
|
-
<a href="/info/Terms&Conditions" class="terms-link">Terms & Conditions</a>
|
|
515
|
+
<a href="/info/Terms&Conditions" target="_blank" class="terms-link">Terms & Conditions</a>
|
|
496
516
|
and
|
|
497
|
-
<a href="/info/PrivacyPolicy" class="terms-link">Privacy Policy</a>.
|
|
517
|
+
<a href="/info/PrivacyPolicy" target="_blank" class="terms-link">Privacy Policy</a>.
|
|
498
518
|
</p>
|
|
499
519
|
</form>
|
|
500
520
|
</div>
|
|
@@ -570,10 +590,13 @@
|
|
|
570
590
|
} else {
|
|
571
591
|
localStorage.removeItem('rememberedUsername');
|
|
572
592
|
}
|
|
573
|
-
|
|
593
|
+
|
|
574
594
|
// Redirect to the appropriate page
|
|
575
595
|
const redirectUrl = new URLSearchParams(window.location.search).get('redirect');
|
|
576
596
|
window.location.href = redirectUrl ? decodeURIComponent(redirectUrl) : '{{customURL}}';
|
|
597
|
+
|
|
598
|
+
loginButton.disabled = false;
|
|
599
|
+
loginButtonText.textContent = 'Login';
|
|
577
600
|
} else {
|
|
578
601
|
// Handle errors
|
|
579
602
|
grecaptcha.reset();
|