@edsis/angular 22.0.11 → 22.0.13
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/fesm2022/edsis-angular-block-shell.mjs +26 -4
- package/fesm2022/edsis-angular-block-shell.mjs.map +1 -1
- package/fesm2022/edsis-angular-module-auth.mjs +136 -72
- package/fesm2022/edsis-angular-module-auth.mjs.map +1 -1
- package/package.json +5 -5
- package/types/edsis-angular-block-shell.d.ts +5 -0
- package/types/edsis-angular-module-auth.d.ts +69 -3
|
@@ -54,6 +54,67 @@ function normalizePath(value, fallback) {
|
|
|
54
54
|
return (normalizedValue.startsWith('/') ? normalizedValue : `/${normalizedValue}`);
|
|
55
55
|
}
|
|
56
56
|
|
|
57
|
+
const DEFAULT_EDSIS_AUTH_MESSAGES = {
|
|
58
|
+
brand: {
|
|
59
|
+
mark: 'ETOS',
|
|
60
|
+
},
|
|
61
|
+
login: {
|
|
62
|
+
title: 'Etos Account Center',
|
|
63
|
+
intro: 'Masukkan email yang terdaftar. Kami akan mengirimkan tautan verifikasi untuk masuk ke aplikasi.',
|
|
64
|
+
badge: 'LOGIN',
|
|
65
|
+
emailPlaceholder: 'your@email.com',
|
|
66
|
+
submit: 'Kirim',
|
|
67
|
+
submitting: 'Mengirim...',
|
|
68
|
+
emailRequired: 'Email wajib diisi.',
|
|
69
|
+
emailInvalid: 'Gunakan format email yang valid dengan panjang maksimal 255 karakter.',
|
|
70
|
+
magicLinkSent: 'Magic link berhasil dikirim.',
|
|
71
|
+
magicLinkFailed: 'Gagal mengirim magic link.',
|
|
72
|
+
oauthComingSoon: 'Segera hadir',
|
|
73
|
+
oauthGoogleAria: 'Login dengan Google segera hadir',
|
|
74
|
+
oauthMicrosoftAria: 'Login dengan Microsoft segera hadir',
|
|
75
|
+
oauthAppleAria: 'Login dengan Apple segera hadir',
|
|
76
|
+
},
|
|
77
|
+
logout: {
|
|
78
|
+
title: 'Mengakhiri sesi Edsis.',
|
|
79
|
+
intro: 'Halaman ini membersihkan sesi lokal lalu memanggil endpoint logout untuk merevoke refresh-token cookie pada backend.',
|
|
80
|
+
badge: 'LOGOUT',
|
|
81
|
+
pending: 'Mengakhiri sesi...',
|
|
82
|
+
pendingAria: 'Mengakhiri sesi',
|
|
83
|
+
success: 'Sesi berhasil diakhiri.',
|
|
84
|
+
failed: 'Sesi lokal sudah dihapus, tetapi request logout gagal.',
|
|
85
|
+
failedNote: 'Backend tidak mengonfirmasi logout, tetapi sesi lokal sudah dihapus.',
|
|
86
|
+
backToLogin: 'Kembali ke login',
|
|
87
|
+
openDashboard: 'Buka dashboard',
|
|
88
|
+
},
|
|
89
|
+
verify: {
|
|
90
|
+
title: 'Memverifikasi magic link.',
|
|
91
|
+
intro: 'Token akan dikonsumsi satu kali, sesi refresh cookie dibentuk di backend, lalu access token disimpan secara lokal untuk aplikasi.',
|
|
92
|
+
badge: 'VERIFY',
|
|
93
|
+
pending: 'Memverifikasi magic link...',
|
|
94
|
+
pendingAria: 'Memverifikasi magic link',
|
|
95
|
+
tokenMissing: 'Token magic link tidak ditemukan pada URL yang dibuka.',
|
|
96
|
+
invalidOrExpired: 'Magic link tidak valid atau sudah kedaluwarsa.',
|
|
97
|
+
successRedirect: 'Verifikasi berhasil. Mengarahkan ke dashboard...',
|
|
98
|
+
missingAccessToken: 'Verifikasi berhasil, tetapi access token tidak ditemukan di respons backend.',
|
|
99
|
+
requestNewLink: 'Minta link baru',
|
|
100
|
+
openDashboard: 'Buka dashboard',
|
|
101
|
+
},
|
|
102
|
+
};
|
|
103
|
+
const EDSIS_AUTH_MESSAGES = new InjectionToken('EDSIS_AUTH_MESSAGES', {
|
|
104
|
+
factory: () => DEFAULT_EDSIS_AUTH_MESSAGES,
|
|
105
|
+
});
|
|
106
|
+
function mergeEdsisAuthMessages(override) {
|
|
107
|
+
if (!override) {
|
|
108
|
+
return DEFAULT_EDSIS_AUTH_MESSAGES;
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
brand: { ...DEFAULT_EDSIS_AUTH_MESSAGES.brand, ...override.brand },
|
|
112
|
+
login: { ...DEFAULT_EDSIS_AUTH_MESSAGES.login, ...override.login },
|
|
113
|
+
logout: { ...DEFAULT_EDSIS_AUTH_MESSAGES.logout, ...override.logout },
|
|
114
|
+
verify: { ...DEFAULT_EDSIS_AUTH_MESSAGES.verify, ...override.verify },
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
|
|
57
118
|
const AUTH_SESSION_STORAGE_KEYS = ['access_token', 'user_id', 'role', 'name'];
|
|
58
119
|
const AUTH_SESSION_METADATA_STORAGE_KEYS = ['access_token_trusted'];
|
|
59
120
|
const AUTH_SESSION_PERSISTENT_HINT_KEY = 'edsis_auth_refresh_hint';
|
|
@@ -606,6 +667,10 @@ function provideEdsisAuth(config) {
|
|
|
606
667
|
provide: EDSIS_AUTH_CONFIG,
|
|
607
668
|
useValue: resolvedConfig,
|
|
608
669
|
},
|
|
670
|
+
{
|
|
671
|
+
provide: EDSIS_AUTH_MESSAGES,
|
|
672
|
+
useValue: mergeEdsisAuthMessages(config.messages),
|
|
673
|
+
},
|
|
609
674
|
]);
|
|
610
675
|
}
|
|
611
676
|
|
|
@@ -730,6 +795,7 @@ class AuthLoginPage {
|
|
|
730
795
|
formBuilder = inject(FormBuilder);
|
|
731
796
|
authMagicLinkService = inject(AuthMagicLinkService);
|
|
732
797
|
authConfig = inject(EDSIS_AUTH_CONFIG);
|
|
798
|
+
messages = inject(EDSIS_AUTH_MESSAGES);
|
|
733
799
|
form = this.formBuilder.nonNullable.group({
|
|
734
800
|
email: ['', [Validators.required, Validators.email, Validators.maxLength(255)]],
|
|
735
801
|
});
|
|
@@ -754,8 +820,8 @@ class AuthLoginPage {
|
|
|
754
820
|
return null;
|
|
755
821
|
}
|
|
756
822
|
return this.emailControl.hasError('required')
|
|
757
|
-
?
|
|
758
|
-
:
|
|
823
|
+
? this.messages.login.emailRequired
|
|
824
|
+
: this.messages.login.emailInvalid;
|
|
759
825
|
}, /* @ts-ignore */
|
|
760
826
|
...(ngDevMode ? [{ debugName: "inlineErrorMessage" }] : /* istanbul ignore next */ []));
|
|
761
827
|
feedbackMessage = computed(() => this.inlineErrorMessage() ?? this.responseMessage() ?? this.errorMessage(), /* @ts-ignore */
|
|
@@ -812,10 +878,10 @@ class AuthLoginPage {
|
|
|
812
878
|
.pipe(takeUntilDestroyed(this.destroyRef), finalize(() => this.isSubmitting.set(false)))
|
|
813
879
|
.subscribe({
|
|
814
880
|
next: (response) => {
|
|
815
|
-
this.responseMessage.set(getResponseMessage(response,
|
|
881
|
+
this.responseMessage.set(getResponseMessage(response, this.messages.login.magicLinkSent));
|
|
816
882
|
},
|
|
817
883
|
error: (error) => {
|
|
818
|
-
this.errorMessage.set(getErrorMessage(error,
|
|
884
|
+
this.errorMessage.set(getErrorMessage(error, this.messages.login.magicLinkFailed));
|
|
819
885
|
},
|
|
820
886
|
});
|
|
821
887
|
}
|
|
@@ -829,19 +895,19 @@ class AuthLoginPage {
|
|
|
829
895
|
<div
|
|
830
896
|
class="flex h-full w-full items-center justify-center px-1 text-[1.25rem] leading-none tracking-[-0.08em] text-primary-foreground sm:text-[1.55rem]"
|
|
831
897
|
style="font-family: 'Arial Black', Arial, sans-serif;">
|
|
832
|
-
|
|
898
|
+
{{ messages.brand.mark }}
|
|
833
899
|
</div>
|
|
834
900
|
</ui-aspect-ratio>
|
|
835
901
|
</div>
|
|
836
902
|
<div class="min-w-0 space-y-0.5 pt-0.5 sm:pt-1">
|
|
837
|
-
<ui-card-title class="text-xl leading-tight sm:text-2xl">
|
|
903
|
+
<ui-card-title class="text-xl leading-tight sm:text-2xl">{{ messages.login.title }}</ui-card-title>
|
|
838
904
|
<p ui-card-description class="max-w-xl leading-6">
|
|
839
|
-
|
|
905
|
+
{{ messages.login.intro }}
|
|
840
906
|
</p>
|
|
841
907
|
</div>
|
|
842
908
|
<ui-card-action
|
|
843
909
|
class="col-start-3 row-span-1 mt-0! pt-0.5 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground sm:pt-1 sm:text-sm">
|
|
844
|
-
|
|
910
|
+
{{ messages.login.badge }}
|
|
845
911
|
</ui-card-action>
|
|
846
912
|
</ui-card-header>
|
|
847
913
|
|
|
@@ -875,7 +941,7 @@ class AuthLoginPage {
|
|
|
875
941
|
[attr.aria-describedby]="feedbackMessage() ? emailFeedbackId : null"
|
|
876
942
|
[attr.aria-invalid]="fieldTone() === 'error' ? 'true' : null"
|
|
877
943
|
formControlName="email"
|
|
878
|
-
placeholder="
|
|
944
|
+
[placeholder]="messages.login.emailPlaceholder" />
|
|
879
945
|
|
|
880
946
|
<button
|
|
881
947
|
ui-input-group-button
|
|
@@ -884,7 +950,7 @@ class AuthLoginPage {
|
|
|
884
950
|
size="sm"
|
|
885
951
|
[disabled]="form.invalid || isSubmitting()"
|
|
886
952
|
class="order-30 h-12! min-w-24 rounded-none px-5 text-sm font-medium">
|
|
887
|
-
{{ isSubmitting() ?
|
|
953
|
+
{{ isSubmitting() ? messages.login.submitting : messages.login.submit }}
|
|
888
954
|
</button>
|
|
889
955
|
</ui-input-group>
|
|
890
956
|
|
|
@@ -916,8 +982,8 @@ class AuthLoginPage {
|
|
|
916
982
|
variant="outline"
|
|
917
983
|
size="lg"
|
|
918
984
|
disabled
|
|
919
|
-
aria-label="
|
|
920
|
-
title="
|
|
985
|
+
[attr.aria-label]="messages.login.oauthGoogleAria"
|
|
986
|
+
[attr.title]="messages.login.oauthComingSoon"
|
|
921
987
|
class="h-12 gap-3 text-[0.74rem] font-medium uppercase tracking-[0.16em]">
|
|
922
988
|
<span class="inline-flex size-6 shrink-0 items-center justify-center" aria-hidden="true">
|
|
923
989
|
<svg viewBox="0 0 24 24" class="size-5" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -943,8 +1009,8 @@ class AuthLoginPage {
|
|
|
943
1009
|
variant="outline"
|
|
944
1010
|
size="lg"
|
|
945
1011
|
disabled
|
|
946
|
-
aria-label="
|
|
947
|
-
title="
|
|
1012
|
+
[attr.aria-label]="messages.login.oauthMicrosoftAria"
|
|
1013
|
+
[attr.title]="messages.login.oauthComingSoon"
|
|
948
1014
|
class="h-12 gap-3 text-[0.74rem] font-medium uppercase tracking-[0.16em]">
|
|
949
1015
|
<span class="inline-flex size-6 shrink-0 items-center justify-center" aria-hidden="true">
|
|
950
1016
|
<svg viewBox="0 0 24 24" class="size-5" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -962,8 +1028,8 @@ class AuthLoginPage {
|
|
|
962
1028
|
variant="outline"
|
|
963
1029
|
size="lg"
|
|
964
1030
|
disabled
|
|
965
|
-
aria-label="
|
|
966
|
-
title="
|
|
1031
|
+
[attr.aria-label]="messages.login.oauthAppleAria"
|
|
1032
|
+
[attr.title]="messages.login.oauthComingSoon"
|
|
967
1033
|
class="h-12 gap-3 text-[0.74rem] font-medium uppercase tracking-[0.16em]">
|
|
968
1034
|
<span class="inline-flex size-6 shrink-0 items-center justify-center" aria-hidden="true">
|
|
969
1035
|
<svg viewBox="0 0 24 24" class="size-5 fill-current" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -1012,19 +1078,19 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
|
|
|
1012
1078
|
<div
|
|
1013
1079
|
class="flex h-full w-full items-center justify-center px-1 text-[1.25rem] leading-none tracking-[-0.08em] text-primary-foreground sm:text-[1.55rem]"
|
|
1014
1080
|
style="font-family: 'Arial Black', Arial, sans-serif;">
|
|
1015
|
-
|
|
1081
|
+
{{ messages.brand.mark }}
|
|
1016
1082
|
</div>
|
|
1017
1083
|
</ui-aspect-ratio>
|
|
1018
1084
|
</div>
|
|
1019
1085
|
<div class="min-w-0 space-y-0.5 pt-0.5 sm:pt-1">
|
|
1020
|
-
<ui-card-title class="text-xl leading-tight sm:text-2xl">
|
|
1086
|
+
<ui-card-title class="text-xl leading-tight sm:text-2xl">{{ messages.login.title }}</ui-card-title>
|
|
1021
1087
|
<p ui-card-description class="max-w-xl leading-6">
|
|
1022
|
-
|
|
1088
|
+
{{ messages.login.intro }}
|
|
1023
1089
|
</p>
|
|
1024
1090
|
</div>
|
|
1025
1091
|
<ui-card-action
|
|
1026
1092
|
class="col-start-3 row-span-1 mt-0! pt-0.5 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground sm:pt-1 sm:text-sm">
|
|
1027
|
-
|
|
1093
|
+
{{ messages.login.badge }}
|
|
1028
1094
|
</ui-card-action>
|
|
1029
1095
|
</ui-card-header>
|
|
1030
1096
|
|
|
@@ -1058,7 +1124,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
|
|
|
1058
1124
|
[attr.aria-describedby]="feedbackMessage() ? emailFeedbackId : null"
|
|
1059
1125
|
[attr.aria-invalid]="fieldTone() === 'error' ? 'true' : null"
|
|
1060
1126
|
formControlName="email"
|
|
1061
|
-
placeholder="
|
|
1127
|
+
[placeholder]="messages.login.emailPlaceholder" />
|
|
1062
1128
|
|
|
1063
1129
|
<button
|
|
1064
1130
|
ui-input-group-button
|
|
@@ -1067,7 +1133,7 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
|
|
|
1067
1133
|
size="sm"
|
|
1068
1134
|
[disabled]="form.invalid || isSubmitting()"
|
|
1069
1135
|
class="order-30 h-12! min-w-24 rounded-none px-5 text-sm font-medium">
|
|
1070
|
-
{{ isSubmitting() ?
|
|
1136
|
+
{{ isSubmitting() ? messages.login.submitting : messages.login.submit }}
|
|
1071
1137
|
</button>
|
|
1072
1138
|
</ui-input-group>
|
|
1073
1139
|
|
|
@@ -1099,8 +1165,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
|
|
|
1099
1165
|
variant="outline"
|
|
1100
1166
|
size="lg"
|
|
1101
1167
|
disabled
|
|
1102
|
-
aria-label="
|
|
1103
|
-
title="
|
|
1168
|
+
[attr.aria-label]="messages.login.oauthGoogleAria"
|
|
1169
|
+
[attr.title]="messages.login.oauthComingSoon"
|
|
1104
1170
|
class="h-12 gap-3 text-[0.74rem] font-medium uppercase tracking-[0.16em]">
|
|
1105
1171
|
<span class="inline-flex size-6 shrink-0 items-center justify-center" aria-hidden="true">
|
|
1106
1172
|
<svg viewBox="0 0 24 24" class="size-5" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -1126,8 +1192,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
|
|
|
1126
1192
|
variant="outline"
|
|
1127
1193
|
size="lg"
|
|
1128
1194
|
disabled
|
|
1129
|
-
aria-label="
|
|
1130
|
-
title="
|
|
1195
|
+
[attr.aria-label]="messages.login.oauthMicrosoftAria"
|
|
1196
|
+
[attr.title]="messages.login.oauthComingSoon"
|
|
1131
1197
|
class="h-12 gap-3 text-[0.74rem] font-medium uppercase tracking-[0.16em]">
|
|
1132
1198
|
<span class="inline-flex size-6 shrink-0 items-center justify-center" aria-hidden="true">
|
|
1133
1199
|
<svg viewBox="0 0 24 24" class="size-5" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -1145,8 +1211,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
|
|
|
1145
1211
|
variant="outline"
|
|
1146
1212
|
size="lg"
|
|
1147
1213
|
disabled
|
|
1148
|
-
aria-label="
|
|
1149
|
-
title="
|
|
1214
|
+
[attr.aria-label]="messages.login.oauthAppleAria"
|
|
1215
|
+
[attr.title]="messages.login.oauthComingSoon"
|
|
1150
1216
|
class="h-12 gap-3 text-[0.74rem] font-medium uppercase tracking-[0.16em]">
|
|
1151
1217
|
<span class="inline-flex size-6 shrink-0 items-center justify-center" aria-hidden="true">
|
|
1152
1218
|
<svg viewBox="0 0 24 24" class="size-5 fill-current" xmlns="http://www.w3.org/2000/svg">
|
|
@@ -1171,11 +1237,12 @@ class AuthLogoutPage {
|
|
|
1171
1237
|
router = inject(Router);
|
|
1172
1238
|
authSessionService = inject(AuthSessionService);
|
|
1173
1239
|
authConfig = inject(EDSIS_AUTH_CONFIG);
|
|
1240
|
+
messages = inject(EDSIS_AUTH_MESSAGES);
|
|
1174
1241
|
guestHomePath = this.authConfig.guestHomePath;
|
|
1175
1242
|
authenticatedHomePath = this.authConfig.authenticatedHomePath;
|
|
1176
1243
|
state = signal('pending', /* @ts-ignore */
|
|
1177
1244
|
...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
1178
|
-
message = signal(
|
|
1245
|
+
message = signal(this.messages.logout.pending, /* @ts-ignore */
|
|
1179
1246
|
...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
1180
1247
|
ngOnInit() {
|
|
1181
1248
|
clearStoredSession(this.documentRef);
|
|
@@ -1189,12 +1256,12 @@ class AuthLogoutPage {
|
|
|
1189
1256
|
.subscribe({
|
|
1190
1257
|
next: (response) => {
|
|
1191
1258
|
this.state.set('success');
|
|
1192
|
-
this.message.set(getResponseMessage(response,
|
|
1259
|
+
this.message.set(getResponseMessage(response, this.messages.logout.success));
|
|
1193
1260
|
void this.router.navigateByUrl(this.guestHomePath, { replaceUrl: true });
|
|
1194
1261
|
},
|
|
1195
1262
|
error: (error) => {
|
|
1196
1263
|
this.state.set('error');
|
|
1197
|
-
this.message.set(getErrorMessage(error,
|
|
1264
|
+
this.message.set(getErrorMessage(error, this.messages.logout.failed));
|
|
1198
1265
|
},
|
|
1199
1266
|
});
|
|
1200
1267
|
}
|
|
@@ -1208,27 +1275,26 @@ class AuthLogoutPage {
|
|
|
1208
1275
|
<div
|
|
1209
1276
|
class="flex h-full w-full items-center justify-center px-1 text-[1.25rem] leading-none tracking-[-0.08em] text-primary-foreground sm:text-[1.55rem]"
|
|
1210
1277
|
style="font-family: 'Arial Black', Arial, sans-serif;">
|
|
1211
|
-
|
|
1278
|
+
{{ messages.brand.mark }}
|
|
1212
1279
|
</div>
|
|
1213
1280
|
</ui-aspect-ratio>
|
|
1214
1281
|
</div>
|
|
1215
1282
|
<div class="min-w-0 space-y-0.5 pt-0.5 sm:pt-1">
|
|
1216
|
-
<ui-card-title class="text-xl leading-tight sm:text-2xl">
|
|
1283
|
+
<ui-card-title class="text-xl leading-tight sm:text-2xl">{{ messages.logout.title }}</ui-card-title>
|
|
1217
1284
|
<p ui-card-description class="max-w-xl leading-6">
|
|
1218
|
-
|
|
1219
|
-
backend.
|
|
1285
|
+
{{ messages.logout.intro }}
|
|
1220
1286
|
</p>
|
|
1221
1287
|
</div>
|
|
1222
1288
|
<ui-card-action
|
|
1223
1289
|
class="col-start-3 row-span-1 mt-0! pt-0.5 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground sm:pt-1 sm:text-sm">
|
|
1224
|
-
|
|
1290
|
+
{{ messages.logout.badge }}
|
|
1225
1291
|
</ui-card-action>
|
|
1226
1292
|
</ui-card-header>
|
|
1227
1293
|
|
|
1228
1294
|
<ui-card-content class="space-y-4 pt-6 sm:pt-7">
|
|
1229
1295
|
<ui-alert [variant]="state() === 'error' ? 'destructive' : 'default'" class="bg-background/70 shadow-sm">
|
|
1230
1296
|
@if (state() === 'pending') {
|
|
1231
|
-
<ui-spinner class="mt-0.5 size-4" aria-label="
|
|
1297
|
+
<ui-spinner class="mt-0.5 size-4" [attr.aria-label]="messages.logout.pendingAria" />
|
|
1232
1298
|
}
|
|
1233
1299
|
|
|
1234
1300
|
<ui-alert-description>
|
|
@@ -1239,15 +1305,15 @@ class AuthLogoutPage {
|
|
|
1239
1305
|
@if (state() === 'error') {
|
|
1240
1306
|
<ui-alert variant="destructive" class="shadow-sm">
|
|
1241
1307
|
<ui-alert-description>
|
|
1242
|
-
|
|
1308
|
+
{{ messages.logout.failedNote }}
|
|
1243
1309
|
</ui-alert-description>
|
|
1244
1310
|
</ui-alert>
|
|
1245
1311
|
}
|
|
1246
1312
|
</ui-card-content>
|
|
1247
1313
|
|
|
1248
1314
|
<ui-card-footer class="flex flex-wrap gap-3 border-t border-border/60 bg-muted/10 pt-4 sm:pt-5">
|
|
1249
|
-
<a ui-button [routerLink]="guestHomePath" variant="default">
|
|
1250
|
-
<a ui-button [routerLink]="authenticatedHomePath" variant="outline">
|
|
1315
|
+
<a ui-button [routerLink]="guestHomePath" variant="default"> {{ messages.logout.backToLogin }} </a>
|
|
1316
|
+
<a ui-button [routerLink]="authenticatedHomePath" variant="outline"> {{ messages.logout.openDashboard }} </a>
|
|
1251
1317
|
</ui-card-footer>
|
|
1252
1318
|
</ui-card>
|
|
1253
1319
|
`, isInline: true, dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "component", type: AlertComponent, selector: "ui-alert", inputs: ["variant", "class"] }, { kind: "component", type: AlertDescriptionComponent, selector: "ui-alert-description", inputs: ["class"] }, { kind: "component", type: AspectRatioComponent, selector: "ui-aspect-ratio", inputs: ["ratio", "class"] }, { kind: "component", type: ButtonComponent, selector: "button[ui-button], a[ui-button]", inputs: ["variant", "size", "class"] }, { kind: "component", type: CardActionComponent, selector: "ui-card-action", inputs: ["class"] }, { kind: "component", type: CardComponent, selector: "ui-card", inputs: ["size", "class"] }, { kind: "component", type: CardContentComponent, selector: "ui-card-content", inputs: ["class"] }, { kind: "component", type: CardDescriptionComponent, selector: "ui-card-description, p[ui-card-description]", inputs: ["class"] }, { kind: "component", type: CardFooterComponent, selector: "ui-card-footer", inputs: ["class"] }, { kind: "component", type: CardHeaderComponent, selector: "ui-card-header", inputs: ["class"] }, { kind: "component", type: CardTitleComponent, selector: "ui-card-title, h3[ui-card-title]", inputs: ["class"] }, { kind: "component", type: SpinnerComponent, selector: "ui-spinner", inputs: ["class", "decorative", "aria-label", "aria-labelledby"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -1283,27 +1349,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
|
|
|
1283
1349
|
<div
|
|
1284
1350
|
class="flex h-full w-full items-center justify-center px-1 text-[1.25rem] leading-none tracking-[-0.08em] text-primary-foreground sm:text-[1.55rem]"
|
|
1285
1351
|
style="font-family: 'Arial Black', Arial, sans-serif;">
|
|
1286
|
-
|
|
1352
|
+
{{ messages.brand.mark }}
|
|
1287
1353
|
</div>
|
|
1288
1354
|
</ui-aspect-ratio>
|
|
1289
1355
|
</div>
|
|
1290
1356
|
<div class="min-w-0 space-y-0.5 pt-0.5 sm:pt-1">
|
|
1291
|
-
<ui-card-title class="text-xl leading-tight sm:text-2xl">
|
|
1357
|
+
<ui-card-title class="text-xl leading-tight sm:text-2xl">{{ messages.logout.title }}</ui-card-title>
|
|
1292
1358
|
<p ui-card-description class="max-w-xl leading-6">
|
|
1293
|
-
|
|
1294
|
-
backend.
|
|
1359
|
+
{{ messages.logout.intro }}
|
|
1295
1360
|
</p>
|
|
1296
1361
|
</div>
|
|
1297
1362
|
<ui-card-action
|
|
1298
1363
|
class="col-start-3 row-span-1 mt-0! pt-0.5 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground sm:pt-1 sm:text-sm">
|
|
1299
|
-
|
|
1364
|
+
{{ messages.logout.badge }}
|
|
1300
1365
|
</ui-card-action>
|
|
1301
1366
|
</ui-card-header>
|
|
1302
1367
|
|
|
1303
1368
|
<ui-card-content class="space-y-4 pt-6 sm:pt-7">
|
|
1304
1369
|
<ui-alert [variant]="state() === 'error' ? 'destructive' : 'default'" class="bg-background/70 shadow-sm">
|
|
1305
1370
|
@if (state() === 'pending') {
|
|
1306
|
-
<ui-spinner class="mt-0.5 size-4" aria-label="
|
|
1371
|
+
<ui-spinner class="mt-0.5 size-4" [attr.aria-label]="messages.logout.pendingAria" />
|
|
1307
1372
|
}
|
|
1308
1373
|
|
|
1309
1374
|
<ui-alert-description>
|
|
@@ -1314,15 +1379,15 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
|
|
|
1314
1379
|
@if (state() === 'error') {
|
|
1315
1380
|
<ui-alert variant="destructive" class="shadow-sm">
|
|
1316
1381
|
<ui-alert-description>
|
|
1317
|
-
|
|
1382
|
+
{{ messages.logout.failedNote }}
|
|
1318
1383
|
</ui-alert-description>
|
|
1319
1384
|
</ui-alert>
|
|
1320
1385
|
}
|
|
1321
1386
|
</ui-card-content>
|
|
1322
1387
|
|
|
1323
1388
|
<ui-card-footer class="flex flex-wrap gap-3 border-t border-border/60 bg-muted/10 pt-4 sm:pt-5">
|
|
1324
|
-
<a ui-button [routerLink]="guestHomePath" variant="default">
|
|
1325
|
-
<a ui-button [routerLink]="authenticatedHomePath" variant="outline">
|
|
1389
|
+
<a ui-button [routerLink]="guestHomePath" variant="default"> {{ messages.logout.backToLogin }} </a>
|
|
1390
|
+
<a ui-button [routerLink]="authenticatedHomePath" variant="outline"> {{ messages.logout.openDashboard }} </a>
|
|
1326
1391
|
</ui-card-footer>
|
|
1327
1392
|
</ui-card>
|
|
1328
1393
|
`,
|
|
@@ -1338,6 +1403,7 @@ class AuthVerifyPage {
|
|
|
1338
1403
|
location = inject(Location);
|
|
1339
1404
|
authMagicLinkService = inject(AuthMagicLinkService);
|
|
1340
1405
|
authConfig = inject(EDSIS_AUTH_CONFIG);
|
|
1406
|
+
messages = inject(EDSIS_AUTH_MESSAGES);
|
|
1341
1407
|
queryParamMap = toSignal(this.route.queryParamMap, {
|
|
1342
1408
|
initialValue: this.route.snapshot.queryParamMap,
|
|
1343
1409
|
});
|
|
@@ -1350,7 +1416,7 @@ class AuthVerifyPage {
|
|
|
1350
1416
|
authenticatedHomePath = this.authConfig.authenticatedHomePath;
|
|
1351
1417
|
state = signal('pending', /* @ts-ignore */
|
|
1352
1418
|
...(ngDevMode ? [{ debugName: "state" }] : /* istanbul ignore next */ []));
|
|
1353
|
-
message = signal(
|
|
1419
|
+
message = signal(this.messages.verify.pending, /* @ts-ignore */
|
|
1354
1420
|
...(ngDevMode ? [{ debugName: "message" }] : /* istanbul ignore next */ []));
|
|
1355
1421
|
token = input(undefined, /* @ts-ignore */
|
|
1356
1422
|
...(ngDevMode ? [{ debugName: "token" }] : /* istanbul ignore next */ []));
|
|
@@ -1365,7 +1431,7 @@ class AuthVerifyPage {
|
|
|
1365
1431
|
this.handledToken = null;
|
|
1366
1432
|
this.clearTokenFromAddressBar();
|
|
1367
1433
|
this.state.set('error');
|
|
1368
|
-
this.message.set(
|
|
1434
|
+
this.message.set(this.messages.verify.tokenMissing);
|
|
1369
1435
|
return;
|
|
1370
1436
|
}
|
|
1371
1437
|
if (token === this.handledToken) {
|
|
@@ -1374,7 +1440,7 @@ class AuthVerifyPage {
|
|
|
1374
1440
|
this.handledToken = token;
|
|
1375
1441
|
this.clearTokenFromAddressBar();
|
|
1376
1442
|
this.state.set('pending');
|
|
1377
|
-
this.message.set(
|
|
1443
|
+
this.message.set(this.messages.verify.pending);
|
|
1378
1444
|
this.verify(token);
|
|
1379
1445
|
});
|
|
1380
1446
|
}
|
|
@@ -1395,16 +1461,16 @@ class AuthVerifyPage {
|
|
|
1395
1461
|
const session = persistSession(this.documentRef, response.data);
|
|
1396
1462
|
if (!session) {
|
|
1397
1463
|
this.state.set('error');
|
|
1398
|
-
this.message.set(
|
|
1464
|
+
this.message.set(this.messages.verify.missingAccessToken);
|
|
1399
1465
|
return;
|
|
1400
1466
|
}
|
|
1401
1467
|
this.state.set('success');
|
|
1402
|
-
this.message.set(getResponseMessage(response,
|
|
1468
|
+
this.message.set(getResponseMessage(response, this.messages.verify.successRedirect));
|
|
1403
1469
|
void this.router.navigateByUrl(this.authenticatedHomePath, { replaceUrl: true });
|
|
1404
1470
|
},
|
|
1405
1471
|
error: (error) => {
|
|
1406
1472
|
this.state.set('error');
|
|
1407
|
-
this.message.set(getErrorMessage(error,
|
|
1473
|
+
this.message.set(getErrorMessage(error, this.messages.verify.invalidOrExpired));
|
|
1408
1474
|
},
|
|
1409
1475
|
});
|
|
1410
1476
|
}
|
|
@@ -1418,27 +1484,26 @@ class AuthVerifyPage {
|
|
|
1418
1484
|
<div
|
|
1419
1485
|
class="flex h-full w-full items-center justify-center px-1 text-[1.25rem] leading-none tracking-[-0.08em] text-primary-foreground sm:text-[1.55rem]"
|
|
1420
1486
|
style="font-family: 'Arial Black', Arial, sans-serif;">
|
|
1421
|
-
|
|
1487
|
+
{{ messages.brand.mark }}
|
|
1422
1488
|
</div>
|
|
1423
1489
|
</ui-aspect-ratio>
|
|
1424
1490
|
</div>
|
|
1425
1491
|
<div class="min-w-0 space-y-0.5 pt-0.5 sm:pt-1">
|
|
1426
|
-
<ui-card-title class="text-xl leading-tight sm:text-2xl">
|
|
1492
|
+
<ui-card-title class="text-xl leading-tight sm:text-2xl">{{ messages.verify.title }}</ui-card-title>
|
|
1427
1493
|
<p ui-card-description class="max-w-xl leading-6">
|
|
1428
|
-
|
|
1429
|
-
lokal untuk aplikasi.
|
|
1494
|
+
{{ messages.verify.intro }}
|
|
1430
1495
|
</p>
|
|
1431
1496
|
</div>
|
|
1432
1497
|
<ui-card-action
|
|
1433
1498
|
class="col-start-3 row-span-1 mt-0! pt-0.5 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground sm:pt-1 sm:text-sm">
|
|
1434
|
-
|
|
1499
|
+
{{ messages.verify.badge }}
|
|
1435
1500
|
</ui-card-action>
|
|
1436
1501
|
</ui-card-header>
|
|
1437
1502
|
|
|
1438
1503
|
<ui-card-content class="space-y-4 pt-6 sm:pt-7">
|
|
1439
1504
|
<ui-alert [variant]="state() === 'error' ? 'destructive' : 'default'" class="bg-background/70 shadow-sm">
|
|
1440
1505
|
@if (state() === 'pending') {
|
|
1441
|
-
<ui-spinner class="mt-0.5 size-4" aria-label="
|
|
1506
|
+
<ui-spinner class="mt-0.5 size-4" [attr.aria-label]="messages.verify.pendingAria" />
|
|
1442
1507
|
}
|
|
1443
1508
|
|
|
1444
1509
|
<ui-alert-description>
|
|
@@ -1456,8 +1521,8 @@ class AuthVerifyPage {
|
|
|
1456
1521
|
</ui-card-content>
|
|
1457
1522
|
|
|
1458
1523
|
<ui-card-footer class="flex flex-wrap gap-3 border-t border-border/60 bg-muted/10 pt-4 sm:pt-5">
|
|
1459
|
-
<a ui-button [routerLink]="guestHomePath" variant="outline">
|
|
1460
|
-
<a ui-button [routerLink]="authenticatedHomePath" variant="default">
|
|
1524
|
+
<a ui-button [routerLink]="guestHomePath" variant="outline"> {{ messages.verify.requestNewLink }} </a>
|
|
1525
|
+
<a ui-button [routerLink]="authenticatedHomePath" variant="default"> {{ messages.verify.openDashboard }} </a>
|
|
1461
1526
|
</ui-card-footer>
|
|
1462
1527
|
</ui-card>
|
|
1463
1528
|
`, isInline: true, dependencies: [{ kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "browserUrl", "routerLink"] }, { kind: "component", type: AlertComponent, selector: "ui-alert", inputs: ["variant", "class"] }, { kind: "component", type: AlertDescriptionComponent, selector: "ui-alert-description", inputs: ["class"] }, { kind: "component", type: AspectRatioComponent, selector: "ui-aspect-ratio", inputs: ["ratio", "class"] }, { kind: "component", type: ButtonComponent, selector: "button[ui-button], a[ui-button]", inputs: ["variant", "size", "class"] }, { kind: "component", type: CardActionComponent, selector: "ui-card-action", inputs: ["class"] }, { kind: "component", type: CardComponent, selector: "ui-card", inputs: ["size", "class"] }, { kind: "component", type: CardContentComponent, selector: "ui-card-content", inputs: ["class"] }, { kind: "component", type: CardDescriptionComponent, selector: "ui-card-description, p[ui-card-description]", inputs: ["class"] }, { kind: "component", type: CardFooterComponent, selector: "ui-card-footer", inputs: ["class"] }, { kind: "component", type: CardHeaderComponent, selector: "ui-card-header", inputs: ["class"] }, { kind: "component", type: CardTitleComponent, selector: "ui-card-title, h3[ui-card-title]", inputs: ["class"] }, { kind: "component", type: SpinnerComponent, selector: "ui-spinner", inputs: ["class", "decorative", "aria-label", "aria-labelledby"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
|
|
@@ -1493,27 +1558,26 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
|
|
|
1493
1558
|
<div
|
|
1494
1559
|
class="flex h-full w-full items-center justify-center px-1 text-[1.25rem] leading-none tracking-[-0.08em] text-primary-foreground sm:text-[1.55rem]"
|
|
1495
1560
|
style="font-family: 'Arial Black', Arial, sans-serif;">
|
|
1496
|
-
|
|
1561
|
+
{{ messages.brand.mark }}
|
|
1497
1562
|
</div>
|
|
1498
1563
|
</ui-aspect-ratio>
|
|
1499
1564
|
</div>
|
|
1500
1565
|
<div class="min-w-0 space-y-0.5 pt-0.5 sm:pt-1">
|
|
1501
|
-
<ui-card-title class="text-xl leading-tight sm:text-2xl">
|
|
1566
|
+
<ui-card-title class="text-xl leading-tight sm:text-2xl">{{ messages.verify.title }}</ui-card-title>
|
|
1502
1567
|
<p ui-card-description class="max-w-xl leading-6">
|
|
1503
|
-
|
|
1504
|
-
lokal untuk aplikasi.
|
|
1568
|
+
{{ messages.verify.intro }}
|
|
1505
1569
|
</p>
|
|
1506
1570
|
</div>
|
|
1507
1571
|
<ui-card-action
|
|
1508
1572
|
class="col-start-3 row-span-1 mt-0! pt-0.5 text-xs font-medium uppercase tracking-[0.24em] text-muted-foreground sm:pt-1 sm:text-sm">
|
|
1509
|
-
|
|
1573
|
+
{{ messages.verify.badge }}
|
|
1510
1574
|
</ui-card-action>
|
|
1511
1575
|
</ui-card-header>
|
|
1512
1576
|
|
|
1513
1577
|
<ui-card-content class="space-y-4 pt-6 sm:pt-7">
|
|
1514
1578
|
<ui-alert [variant]="state() === 'error' ? 'destructive' : 'default'" class="bg-background/70 shadow-sm">
|
|
1515
1579
|
@if (state() === 'pending') {
|
|
1516
|
-
<ui-spinner class="mt-0.5 size-4" aria-label="
|
|
1580
|
+
<ui-spinner class="mt-0.5 size-4" [attr.aria-label]="messages.verify.pendingAria" />
|
|
1517
1581
|
}
|
|
1518
1582
|
|
|
1519
1583
|
<ui-alert-description>
|
|
@@ -1531,8 +1595,8 @@ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.0.0", ngImpor
|
|
|
1531
1595
|
</ui-card-content>
|
|
1532
1596
|
|
|
1533
1597
|
<ui-card-footer class="flex flex-wrap gap-3 border-t border-border/60 bg-muted/10 pt-4 sm:pt-5">
|
|
1534
|
-
<a ui-button [routerLink]="guestHomePath" variant="outline">
|
|
1535
|
-
<a ui-button [routerLink]="authenticatedHomePath" variant="default">
|
|
1598
|
+
<a ui-button [routerLink]="guestHomePath" variant="outline"> {{ messages.verify.requestNewLink }} </a>
|
|
1599
|
+
<a ui-button [routerLink]="authenticatedHomePath" variant="default"> {{ messages.verify.openDashboard }} </a>
|
|
1536
1600
|
</ui-card-footer>
|
|
1537
1601
|
</ui-card>
|
|
1538
1602
|
`,
|
|
@@ -1570,5 +1634,5 @@ const authRoutes = [
|
|
|
1570
1634
|
* Generated bundle index. Do not edit.
|
|
1571
1635
|
*/
|
|
1572
1636
|
|
|
1573
|
-
export { AUTH_SESSION_CHANGE_EVENT, AuthLoginPage, AuthLogoutPage, AuthShellPage, AuthVerifyPage, EDSIS_AUTH_CONFIG, EDSIS_SKIP_AUTH, EDSIS_SKIP_SESSION_REFRESH, authRoutes, authenticatedGuard, clearStoredSession, edsisAuthInterceptor, guestOnlyGuard, hasStoredSession, homeRedirectGuard, injectSessionClear, injectSessionRefresh, injectSessionState, persistSession, provideEdsisAuth, readStoredAccessToken, readStoredSession, resolveEdsisAuthConfig, shouldClearSessionAfterRefreshFailure, startAuthSessionMonitor, validateStoredSession, ɵresetAuthSessionModuleState };
|
|
1637
|
+
export { AUTH_SESSION_CHANGE_EVENT, AuthLoginPage, AuthLogoutPage, AuthShellPage, AuthVerifyPage, DEFAULT_EDSIS_AUTH_MESSAGES, EDSIS_AUTH_CONFIG, EDSIS_AUTH_MESSAGES, EDSIS_SKIP_AUTH, EDSIS_SKIP_SESSION_REFRESH, authRoutes, authenticatedGuard, clearStoredSession, edsisAuthInterceptor, guestOnlyGuard, hasStoredSession, homeRedirectGuard, injectSessionClear, injectSessionRefresh, injectSessionState, mergeEdsisAuthMessages, persistSession, provideEdsisAuth, readStoredAccessToken, readStoredSession, resolveEdsisAuthConfig, shouldClearSessionAfterRefreshFailure, startAuthSessionMonitor, validateStoredSession, ɵresetAuthSessionModuleState };
|
|
1574
1638
|
//# sourceMappingURL=edsis-angular-module-auth.mjs.map
|