mbkauthe 4.7.1 → 4.7.2

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/public/main.css CHANGED
@@ -12,6 +12,18 @@
12
12
  --success: #43e97b;
13
13
  --warning: #ffd166;
14
14
  --danger: #ff7675;
15
+ --surface-1: #0a1414;
16
+ --surface-2: #101c1c;
17
+ --surface-soft: rgba(255, 255, 255, 0.05);
18
+ --surface-muted: rgba(0, 0, 0, 0.25);
19
+ --glass-bg: rgba(10, 20, 20, 0.95);
20
+ --glass-border: rgba(0, 184, 148, 0.2);
21
+ --input-bg: rgba(0, 0, 0, .3);
22
+ --input-bg-focus: rgba(0, 0, 0, .4);
23
+ --input-border: rgba(0, 184, 148, 0.3);
24
+ --muted-border: rgba(255, 255, 255, 0.12);
25
+ --hero-from: #0a1414;
26
+ --hero-to: #1769aa;
15
27
  --border-radius: 8px;
16
28
  --box-shadow: 0 4px 10px rgba(33, 150, 243, 0.15);
17
29
  --transition: all 0.3s cubic-bezier(.4, 0, .2, 1);
@@ -24,6 +36,29 @@
24
36
  --text-size-xl: 2rem;
25
37
  }
26
38
 
39
+ [data-theme="light"] {
40
+ --dark: #f8fbfd;
41
+ --darker: #eef6fb;
42
+ --light: #06222f;
43
+ --text: #163041;
44
+ --text-light: #4a6475;
45
+ --text-dark: #0e2230;
46
+ --warning: #a66900;
47
+ --surface-1: rgba(255, 255, 255, 0.9);
48
+ --surface-2: #f8fbfd;
49
+ --surface-soft: rgba(255, 255, 255, 0.88);
50
+ --surface-muted: rgba(6, 34, 47, 0.06);
51
+ --glass-bg: rgba(255, 255, 255, 0.88);
52
+ --glass-border: rgba(0, 184, 148, 0.22);
53
+ --input-bg: rgba(255, 255, 255, 0.84);
54
+ --input-bg-focus: rgba(255, 255, 255, 1);
55
+ --input-border: rgba(22, 48, 65, 0.2);
56
+ --muted-border: rgba(22, 48, 65, 0.14);
57
+ --hero-from: #d7e9f6;
58
+ --hero-to: #a7cde4;
59
+ --box-shadow: 0 10px 28px rgba(8, 35, 51, 0.12);
60
+ }
61
+
27
62
  * {
28
63
  margin: 0;
29
64
  padding: 0;
@@ -32,7 +67,7 @@
32
67
  }
33
68
 
34
69
  body {
35
- background-color: var(--dark);
70
+ background: linear-gradient(180deg, var(--surface-2), var(--dark));
36
71
  color: var(--text);
37
72
  min-height: 100vh;
38
73
  display: flex;
@@ -41,13 +76,14 @@ body {
41
76
  }
42
77
 
43
78
  header {
44
- background-color: var(--darker);
79
+ background-color: var(--surface-1);
45
80
  box-shadow: var(--box-shadow);
46
81
  position: fixed;
47
82
  width: 100%;
48
83
  z-index: 1000;
49
84
  transition: var(--transition);
50
- border-bottom: .125rem solid rgba(255, 255, 255, .1);
85
+ border-bottom: .125rem solid var(--muted-border);
86
+ backdrop-filter: blur(8px);
51
87
  }
52
88
 
53
89
  .header-container {
@@ -100,7 +136,7 @@ header {
100
136
  padding: 120px 1.7rem 20px;
101
137
  position: relative;
102
138
  overflow: hidden;
103
- background: linear-gradient(135deg, var(--darker), var(--primary-dark));
139
+ background: linear-gradient(135deg, var(--hero-from), var(--hero-to));
104
140
  }
105
141
 
106
142
  .login-container::before {
@@ -115,15 +151,22 @@ header {
115
151
  z-index: 0;
116
152
  }
117
153
 
154
+ [data-theme="light"] .login-container {
155
+ background:
156
+ radial-gradient(circle at 12% 18%, color-mix(in srgb, var(--primary) 18%, transparent 82%), transparent 48%),
157
+ radial-gradient(circle at 86% 78%, color-mix(in srgb, var(--accent) 14%, transparent 86%), transparent 54%),
158
+ linear-gradient(135deg, var(--hero-from), var(--hero-to));
159
+ }
160
+
118
161
  .login-box {
119
- background: rgba(10, 20, 20, 0.95);
162
+ background: var(--glass-bg);
120
163
  backdrop-filter: blur(10px);
121
164
  border-radius: var(--border-radius);
122
165
  padding: 2.5rem;
123
166
  width: 100%;
124
167
  max-width: 450px;
125
168
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
126
- border: 1px solid rgba(0, 184, 148, 0.2);
169
+ border: 1px solid var(--glass-border);
127
170
  position: relative;
128
171
  z-index: 2;
129
172
  transition: var(--transition);
@@ -191,8 +234,8 @@ header {
191
234
  .form-input {
192
235
  width: 100%;
193
236
  padding: 14px 20px;
194
- background: rgba(0, 0, 0, .3);
195
- border: 2px solid rgba(0, 184, 148, 0.3);
237
+ background: var(--input-bg);
238
+ border: 2px solid var(--input-border);
196
239
  border-radius: var(--border-radius);
197
240
  color: var(--text);
198
241
  font-size: var(--text-size-md);
@@ -201,7 +244,7 @@ header {
201
244
 
202
245
  .form-input:focus {
203
246
  outline: none;
204
- background: rgba(0, 0, 0, .4);
247
+ background: var(--input-bg-focus);
205
248
  border-color: var(--accent);
206
249
  box-shadow: 0 0 0 3px rgba(0, 184, 148, 0.2);
207
250
  }
@@ -228,7 +271,7 @@ header {
228
271
  top: -10px;
229
272
  left: 15px;
230
273
  font-size: 0.8rem;
231
- background: rgba(10, 20, 20, 0.95);
274
+ background: var(--glass-bg);
232
275
  padding: 0 5px;
233
276
  color: var(--accent);
234
277
  }
@@ -276,9 +319,9 @@ header {
276
319
  position: relative;
277
320
  z-index: 1;
278
321
  overflow: hidden;
279
- background: rgba(255, 255, 255, 0.05);
322
+ background: var(--surface-soft);
280
323
  color: var(--text);
281
- border-color: rgba(255, 255, 255, 0.15);
324
+ border-color: var(--muted-border);
282
325
  }
283
326
 
284
327
  .swi:hover {
@@ -292,13 +335,13 @@ header {
292
335
  }
293
336
 
294
337
  .btn-login:hover {
295
- background: var(--dark);
338
+ background: var(--surface-1);
296
339
  color: var(--accent);
297
340
  box-shadow: 0 6px 20px rgba(0, 184, 148, 0.3);
298
341
  }
299
342
 
300
343
  .btn-login:disabled {
301
- background: var(--dark);
344
+ background: var(--surface-1);
302
345
  color: var(--accent);
303
346
  cursor: not-allowed;
304
347
  transform: none;
@@ -327,7 +370,7 @@ header {
327
370
  }
328
371
 
329
372
  .divider span {
330
- background: rgba(10, 20, 20, 0.95);
373
+ background: var(--glass-bg);
331
374
  padding: 0 15px;
332
375
  color: var(--text-light);
333
376
  font-size: 0.9rem;
@@ -463,8 +506,8 @@ header {
463
506
  -webkit-appearance: none;
464
507
  width: 18px;
465
508
  height: 18px;
466
- background: rgba(0, 0, 0, .3);
467
- border: 2px solid rgba(0, 184, 148, 0.3);
509
+ background: var(--input-bg);
510
+ border: 2px solid var(--input-border);
468
511
  border-radius: var(--border-radius);
469
512
  margin-right: 10px;
470
513
  cursor: pointer;
@@ -507,7 +550,7 @@ header {
507
550
  width: 100%;
508
551
  margin: 1.5rem 0;
509
552
  padding: 1rem;
510
- background: rgba(0, 184, 148, 0.05);
553
+ background: color-mix(in srgb, var(--accent) 7%, transparent 93%);
511
554
  border: 1px solid rgba(0, 184, 148, 0.2);
512
555
  border-radius: var(--border-radius);
513
556
  transition: var(--transition);
@@ -531,7 +574,7 @@ header {
531
574
  -webkit-appearance: none;
532
575
  width: 20px;
533
576
  height: 20px;
534
- background: rgba(0, 0, 0, .3);
577
+ background: var(--input-bg);
535
578
  border: 2px solid rgba(0, 184, 148, 0.4);
536
579
  border-radius: 5px;
537
580
  cursor: pointer;
@@ -613,12 +656,12 @@ header {
613
656
  position: fixed;
614
657
  bottom: 20px;
615
658
  right: 20px;
616
- background: rgba(255, 255, 255, .1);
659
+ background: var(--surface-soft);
617
660
  color: var(--text-light);
618
661
  padding: 8px 12px;
619
662
  border-radius: var(--border-radius);
620
663
  font-size: 0.75rem;
621
- border: 1px solid rgba(255, 255, 255, .1);
664
+ border: 1px solid var(--muted-border);
622
665
  z-index: 999;
623
666
  transition: var(--transition);
624
667
  backdrop-filter: blur(5px);
@@ -649,7 +692,7 @@ header {
649
692
  width: 40%;
650
693
  background: linear-gradient(135deg, rgba(33, 150, 243, 0.08), rgba(0, 184, 148, 0.08));
651
694
  padding: 2.5rem 2rem;
652
- border-right: 1px solid rgba(0, 184, 148, 0.3);
695
+ border-right: 1px solid color-mix(in srgb, var(--accent) 32%, transparent 68%);
653
696
  position: relative;
654
697
  overflow: hidden;
655
698
  }
@@ -740,9 +783,9 @@ header {
740
783
  }
741
784
 
742
785
  .btn-google-side {
743
- background: rgba(255, 255, 255, 0.05);
786
+ background: var(--surface-soft);
744
787
  color: var(--text);
745
- border-color: rgba(255, 255, 255, 0.15);
788
+ border-color: var(--muted-border);
746
789
  }
747
790
 
748
791
  .btn-google-side:hover {
@@ -756,9 +799,9 @@ header {
756
799
  }
757
800
 
758
801
  .btn-switch-side {
759
- background: rgba(255, 255, 255, 0.05);
802
+ background: var(--surface-soft);
760
803
  color: var(--text);
761
- border-color: rgba(255, 255, 255, 0.15);
804
+ border-color: var(--muted-border);
762
805
  }
763
806
 
764
807
  .btn-switch-side:hover {
@@ -773,7 +816,7 @@ header {
773
816
  gap: 0.75rem;
774
817
  margin-top: auto;
775
818
  padding-top: 2rem;
776
- border-top: 1px solid rgba(255, 255, 255, 0.12);
819
+ border-top: 1px solid var(--muted-border);
777
820
  position: relative;
778
821
  z-index: 1;
779
822
  }
@@ -809,7 +852,7 @@ header {
809
852
  display: flex;
810
853
  flex-direction: column;
811
854
  justify-content: center;
812
- background: rgba(0, 0, 0, 0.2);
855
+ background: var(--surface-muted);
813
856
  }
814
857
 
815
858
  .login-form {
@@ -843,6 +886,44 @@ header {
843
886
  }
844
887
  }
845
888
 
889
+ .logo-centered {
890
+ justify-content: center;
891
+ margin-bottom: 1rem;
892
+ }
893
+
894
+ .form-row-split {
895
+ display: flex;
896
+ justify-content: space-between;
897
+ align-items: center;
898
+ margin-bottom: 1rem;
899
+ gap: 0.75rem;
900
+ }
901
+
902
+ .remember-me-inline {
903
+ margin-bottom: 0;
904
+ }
905
+
906
+ .login-link-nowrap {
907
+ margin-bottom: 0;
908
+ white-space: nowrap;
909
+ }
910
+
911
+ .hidden-by-default {
912
+ display: none;
913
+ }
914
+
915
+ .btn-login-inline {
916
+ text-decoration: none;
917
+ display: inline-block;
918
+ margin-top: 10px;
919
+ text-align: center;
920
+ line-height: 40px;
921
+ }
922
+
923
+ .link-no-decoration {
924
+ text-decoration: none;
925
+ }
926
+
846
927
  @media (max-width: 400px) {
847
928
 
848
929
  .logo svg,
package/public/main.js CHANGED
@@ -37,14 +37,18 @@ async function selectiveCacheClear() {
37
37
  'sessionId',
38
38
  'mbkauthe.sid',
39
39
  'fullName',
40
- '_csrf'
40
+ '_csrf',
41
+ 'profileImageUser',
42
+ 'profileImageUrl'
41
43
  ];
42
44
 
43
45
  const localStorageToClear = [
44
46
  'sessionId',
45
47
  'mbkauthe.sid',
46
48
  'fullName',
47
- '_csrf'
49
+ '_csrf',
50
+ 'profileImageUser',
51
+ 'profileImageUrl'
48
52
  ];
49
53
 
50
54
  // 1. Clear selected localStorage keys
@@ -5,6 +5,7 @@
5
5
  <meta name="keywords" content="MBK Tech, authentication, login, secure portal, 2FA, OAuth">
6
6
  <meta name="robots" content="index,follow,max-image-preview:large">
7
7
  <meta name="author" content="MBK Tech">
8
+ <meta name="color-scheme" content="dark light">
8
9
  <meta property="og:title" content="{{#if pageTitle}}{{pageTitle}}{{else}}{{#if pageCode}}{{pageCode}}{{/if}}{{#if pageError}} - {{pageError}}{{/if}}{{/if}} | MBK Tech Portal" />
9
10
  <meta property="og:description" content="{{#if description}}{{description}}{{else}}Secure authentication portal for MBK Tech accounts, project access, and session management.{{/if}}" />
10
11
  <meta property="og:type" content="website" />
@@ -13,6 +14,17 @@
13
14
  <meta property="og:url" content="{{#if ogUrl}}{{ogUrl}}{{else}}/mbkauthe/login{{/if}}">
14
15
  <link rel="canonical" href="{{#if ogUrl}}{{ogUrl}}{{else}}/mbkauthe/login{{/if}}">
15
16
  <title>{{#if pageTitle}}{{pageTitle}}{{else}}{{#if pageCode}}{{pageCode}}{{/if}}{{#if pageError}} - {{pageError}}{{/if}}{{/if}} | MBK Tech Portal</title>
17
+ <script>
18
+ (() => {
19
+ const storedTheme = localStorage.getItem('mbkauthe-theme');
20
+ const prefersLight = window.matchMedia && window.matchMedia('(prefers-color-scheme: light)').matches;
21
+ const resolvedTheme = storedTheme === 'light' || storedTheme === 'dark'
22
+ ? storedTheme
23
+ : (prefersLight ? 'light' : 'dark');
24
+
25
+ document.documentElement.setAttribute('data-theme', resolvedTheme);
26
+ })();
27
+ </script>
16
28
  <link rel="icon" type="image/png" href="/icon.png">
17
29
  <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.4.0/css/all.min.css">
18
30
  {{> sharedStyles}}
@@ -16,7 +16,7 @@
16
16
  <div class="login-sidebar">
17
17
  <div class="sidebar-content">
18
18
  <div class="brand-section">
19
- <div class="logo" style="justify-content: center;margin-bottom: 1rem;">
19
+ <div class="logo logo-centered">
20
20
  <img src="/icon.svg" alt="Logo" class="logo-image">
21
21
  <span class="logo-text">BK <span>Tech</span></span>
22
22
  </div>
@@ -54,10 +54,9 @@
54
54
  </div>
55
55
  </div>
56
56
 
57
- <div id="emptyState" class="empty-state" style="display:none;">
57
+ <div id="emptyState" class="empty-state hidden-by-default">
58
58
  <p>No signed-in accounts found.</p>
59
- <a href="/mbkauthe/login" class="btn-login"
60
- style="text-decoration: none; display: inline-block; margin-top: 10px; text-align: center; line-height: 40px;">Go
59
+ <a href="/mbkauthe/login" class="btn-login btn-login-inline">Go
61
60
  to Login</a>
62
61
  </div>
63
62
 
@@ -120,8 +119,8 @@
120
119
  align-items: center;
121
120
  gap: 16px;
122
121
  padding: 14px 20px;
123
- background: rgba(0, 0, 0, .3);
124
- border: 2px solid rgba(0, 184, 148, 0.1);
122
+ background: var(--input-bg);
123
+ border: 2px solid color-mix(in srgb, var(--accent) 22%, transparent 78%);
125
124
  border-radius: var(--border-radius);
126
125
  cursor: pointer;
127
126
  transition: var(--transition);
@@ -132,7 +131,7 @@
132
131
  }
133
132
 
134
133
  .account-item:hover {
135
- background: rgba(0, 0, 0, .4);
134
+ background: var(--input-bg-focus);
136
135
  border-color: var(--accent);
137
136
  box-shadow: 0 4px 15px rgba(0, 184, 148, 0.15);
138
137
  }
@@ -217,9 +216,9 @@
217
216
  }
218
217
 
219
218
  .btn-logout {
220
- background: rgba(255, 255, 255, 0.05);
219
+ background: var(--surface-soft);
221
220
  color: var(--text-light);
222
- border-color: rgba(255, 255, 255, 0.15);
221
+ border-color: var(--muted-border);
223
222
  width: 100%;
224
223
  max-width: 420px;
225
224
  cursor: pointer;
@@ -233,6 +232,28 @@
233
232
  box-shadow: 0 4px 15px rgba(255, 118, 117, 0.15);
234
233
  }
235
234
 
235
+ [data-theme="light"] .account-item {
236
+ background: rgba(255, 255, 255, 0.95);
237
+ border-color: rgba(0, 184, 148, 0.18);
238
+ }
239
+
240
+ [data-theme="light"] .account-item:hover {
241
+ background: rgba(255, 255, 255, 1);
242
+ }
243
+
244
+ [data-theme="light"] .btn-social.btn-logout {
245
+ background: var(--accent);
246
+ color: #ffffff;
247
+ border-color: var(--accent);
248
+ }
249
+
250
+ [data-theme="light"] .btn-social.btn-logout:hover {
251
+ background: rgba(255, 118, 117, 0.1);
252
+ border-color: var(--danger);
253
+ color: var(--danger);
254
+ box-shadow: 0 4px 15px rgba(255, 118, 117, 0.15);
255
+ }
256
+
236
257
  .loading-spinner {
237
258
  display: flex;
238
259
  justify-content: center;
@@ -242,7 +263,7 @@
242
263
  .spinner {
243
264
  width: 30px;
244
265
  height: 30px;
245
- border: 3px solid rgba(255, 255, 255, 0.1);
266
+ border: 3px solid var(--muted-border);
246
267
  border-top-color: var(--accent);
247
268
  border-radius: 50%;
248
269
  animation: spin 0.8s linear infinite;
@@ -258,9 +279,9 @@
258
279
  text-align: center;
259
280
  padding: 30px;
260
281
  color: var(--text-light);
261
- background: rgba(0, 0, 0, 0.2);
282
+ background: var(--surface-muted);
262
283
  border-radius: var(--border-radius);
263
- border: 1px dashed rgba(255, 255, 255, 0.1);
284
+ border: 1px dashed var(--muted-border);
264
285
  }
265
286
 
266
287
  /* Mobile adjustments */
@@ -279,7 +300,7 @@
279
300
  gap: 12px;
280
301
  margin-top: 30px;
281
302
  padding-top: 20px;
282
- border-top: 1px solid rgba(255, 255, 255, 0.1);
303
+ border-top: 1px solid var(--muted-border);
283
304
  }
284
305
 
285
306
  .mobile-switch-btn,
@@ -298,13 +319,13 @@
298
319
  }
299
320
 
300
321
  .mobile-switch-btn {
301
- background: rgba(255, 255, 255, 0.05);
302
- border: 1px solid rgba(255, 255, 255, 0.15);
322
+ background: var(--surface-soft);
323
+ border: 1px solid var(--muted-border);
303
324
  color: var(--text);
304
325
  }
305
326
 
306
327
  .mobile-switch-btn:hover {
307
- background: rgba(255, 255, 255, 0.1);
328
+ background: color-mix(in srgb, var(--accent) 10%, var(--surface-soft) 90%);
308
329
  border-color: var(--accent);
309
330
  color: var(--accent);
310
331
  box-shadow: 0 4px 15px rgba(0, 184, 148, 0.15);