@acorex-platform/module-auth-client 0.0.15 → 0.0.18
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/{acorex-platform-module-auth-client-acorex-platform-module-auth-client-B7tIKOw6.mjs → acorex-platform-module-auth-client-acorex-platform-module-auth-client-mW7tx8C0.mjs} +41 -41
- package/fesm2022/acorex-platform-module-auth-client-acorex-platform-module-auth-client-mW7tx8C0.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-app-chooser.component-Cm2ZagaI.mjs → acorex-platform-module-auth-client-app-chooser.component-IPLp1kVv.mjs} +5 -5
- package/fesm2022/{acorex-platform-module-auth-client-app-chooser.component-Cm2ZagaI.mjs.map → acorex-platform-module-auth-client-app-chooser.component-IPLp1kVv.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-change-password.command-ZyXAjUKw.mjs → acorex-platform-module-auth-client-change-password.command-O8Mgxoqj.mjs} +3 -2
- package/fesm2022/{acorex-platform-module-auth-client-change-password.command-ZyXAjUKw.mjs.map → acorex-platform-module-auth-client-change-password.command-O8Mgxoqj.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-change-photo.command-BC8lw--F.mjs → acorex-platform-module-auth-client-change-photo.command-BcNq9mTU.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-auth-client-change-photo.command-BC8lw--F.mjs.map → acorex-platform-module-auth-client-change-photo.command-BcNq9mTU.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-lock-screen.command-41QnG1TQ.mjs → acorex-platform-module-auth-client-lock-screen.command-PMoJJxe7.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-auth-client-lock-screen.command-41QnG1TQ.mjs.map → acorex-platform-module-auth-client-lock-screen.command-PMoJJxe7.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-login.module-DYtNYzF6.mjs → acorex-platform-module-auth-client-login.module-C4S0RjM7.mjs} +4 -4
- package/fesm2022/{acorex-platform-module-auth-client-login.module-DYtNYzF6.mjs.map → acorex-platform-module-auth-client-login.module-C4S0RjM7.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-master.layout-DpdD9kgk.mjs → acorex-platform-module-auth-client-master.layout-DXwb5VSr.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-auth-client-master.layout-DpdD9kgk.mjs.map → acorex-platform-module-auth-client-master.layout-DXwb5VSr.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-oauth-callback.component-BspBH4Ul.mjs → acorex-platform-module-auth-client-oauth-callback.component-CEMvfjj4.mjs} +5 -5
- package/fesm2022/{acorex-platform-module-auth-client-oauth-callback.component-BspBH4Ul.mjs.map → acorex-platform-module-auth-client-oauth-callback.component-CEMvfjj4.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-open-sessions.command-CXSGuqYp.mjs → acorex-platform-module-auth-client-open-sessions.command-BsS9b6Xk.mjs} +6 -6
- package/fesm2022/{acorex-platform-module-auth-client-open-sessions.command-CXSGuqYp.mjs.map → acorex-platform-module-auth-client-open-sessions.command-BsS9b6Xk.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-password.component-Cihg82vM.mjs → acorex-platform-module-auth-client-password.component-CIr6IBG6.mjs} +8 -8
- package/fesm2022/{acorex-platform-module-auth-client-password.component-Cihg82vM.mjs.map → acorex-platform-module-auth-client-password.component-CIr6IBG6.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-auth-client-password.component-DnFItGdA.mjs +88 -0
- package/fesm2022/acorex-platform-module-auth-client-password.component-DnFItGdA.mjs.map +1 -0
- package/fesm2022/{acorex-platform-module-auth-client-profile-activity-chart.component-B8lBvZsA.mjs → acorex-platform-module-auth-client-profile-activity-chart.component-DTY1eEI_.mjs} +6 -6
- package/fesm2022/{acorex-platform-module-auth-client-profile-activity-chart.component-B8lBvZsA.mjs.map → acorex-platform-module-auth-client-profile-activity-chart.component-DTY1eEI_.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-profile-delete-account-danger-zone.component-CtJho4ab.mjs → acorex-platform-module-auth-client-profile-delete-account-danger-zone.component-C6u3AB4N.mjs} +4 -4
- package/fesm2022/{acorex-platform-module-auth-client-profile-delete-account-danger-zone.component-CtJho4ab.mjs.map → acorex-platform-module-auth-client-profile-delete-account-danger-zone.component-C6u3AB4N.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-profile-page-component.provider-B-Qtd4_j.mjs → acorex-platform-module-auth-client-profile-page-component.provider-Dhmzo4ME.mjs} +4 -4
- package/fesm2022/{acorex-platform-module-auth-client-profile-page-component.provider-B-Qtd4_j.mjs.map → acorex-platform-module-auth-client-profile-page-component.provider-Dhmzo4ME.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-profile-page.component-tbhf7K0V.mjs → acorex-platform-module-auth-client-profile-page.component-CJ9AA3ZN.mjs} +8 -8
- package/fesm2022/{acorex-platform-module-auth-client-profile-page.component-tbhf7K0V.mjs.map → acorex-platform-module-auth-client-profile-page.component-CJ9AA3ZN.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-register-password.component-hSJyEA6Q.mjs → acorex-platform-module-auth-client-register-password.component-ia6tdvTc.mjs} +5 -5
- package/fesm2022/{acorex-platform-module-auth-client-register-password.component-hSJyEA6Q.mjs.map → acorex-platform-module-auth-client-register-password.component-ia6tdvTc.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-register.module-DXm6AQpo.mjs → acorex-platform-module-auth-client-register.module--DG9m8iC.mjs} +4 -4
- package/fesm2022/{acorex-platform-module-auth-client-register.module-DXm6AQpo.mjs.map → acorex-platform-module-auth-client-register.module--DG9m8iC.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-remove-pin-code.command-zUZooOtv.mjs → acorex-platform-module-auth-client-remove-pin-code.command-qtswigkv.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-auth-client-remove-pin-code.command-zUZooOtv.mjs.map → acorex-platform-module-auth-client-remove-pin-code.command-qtswigkv.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-auth-client-reset-password.component-CTlrt_18.mjs +115 -0
- package/fesm2022/acorex-platform-module-auth-client-reset-password.component-CTlrt_18.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-routes-DVN2Y2Ps.mjs +13 -0
- package/fesm2022/acorex-platform-module-auth-client-routes-DVN2Y2Ps.mjs.map +1 -0
- package/fesm2022/acorex-platform-module-auth-client-session-lock-overlay.component-CN1JqPBW.mjs +346 -0
- package/fesm2022/{acorex-platform-module-auth-client-session-lock-overlay.component-DqXGuIgN.mjs.map → acorex-platform-module-auth-client-session-lock-overlay.component-CN1JqPBW.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-set-pin-code.command-DXTVbrS0.mjs → acorex-platform-module-auth-client-set-pin-code.command-mBEdso1T.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-auth-client-set-pin-code.command-DXTVbrS0.mjs.map → acorex-platform-module-auth-client-set-pin-code.command-mBEdso1T.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-set-pin-code.component-5TxB6aFi.mjs → acorex-platform-module-auth-client-set-pin-code.component-BHVqbYFv.mjs} +6 -6
- package/fesm2022/{acorex-platform-module-auth-client-set-pin-code.component-5TxB6aFi.mjs.map → acorex-platform-module-auth-client-set-pin-code.component-BHVqbYFv.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-tenant-chooser.component-ihsqCJKN.mjs → acorex-platform-module-auth-client-tenant-chooser.component-B_9s4F36.mjs} +5 -5
- package/fesm2022/{acorex-platform-module-auth-client-tenant-chooser.component-ihsqCJKN.mjs.map → acorex-platform-module-auth-client-tenant-chooser.component-B_9s4F36.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-two-factor-code.component-CiENsIEh.mjs → acorex-platform-module-auth-client-two-factor-code.component-DAxlYlhM.mjs} +4 -4
- package/fesm2022/{acorex-platform-module-auth-client-two-factor-code.component-CiENsIEh.mjs.map → acorex-platform-module-auth-client-two-factor-code.component-DAxlYlhM.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-two-factor.module-BJqdeuAz.mjs → acorex-platform-module-auth-client-two-factor.module-FAqKbmBb.mjs} +3 -3
- package/fesm2022/{acorex-platform-module-auth-client-two-factor.module-BJqdeuAz.mjs.map → acorex-platform-module-auth-client-two-factor.module-FAqKbmBb.mjs.map} +1 -1
- package/fesm2022/{acorex-platform-module-auth-client-view-login-history.command-Dl0os5lD.mjs → acorex-platform-module-auth-client-view-login-history.command-B42BHIAL.mjs} +2 -2
- package/fesm2022/{acorex-platform-module-auth-client-view-login-history.command-Dl0os5lD.mjs.map → acorex-platform-module-auth-client-view-login-history.command-B42BHIAL.mjs.map} +1 -1
- package/fesm2022/acorex-platform-module-auth-client.mjs +1 -1
- package/package.json +1 -1
- package/fesm2022/acorex-platform-module-auth-client-acorex-platform-module-auth-client-B7tIKOw6.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-password.component-BuqUhET7.mjs +0 -59
- package/fesm2022/acorex-platform-module-auth-client-password.component-BuqUhET7.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-routes-REjaWcqY.mjs +0 -9
- package/fesm2022/acorex-platform-module-auth-client-routes-REjaWcqY.mjs.map +0 -1
- package/fesm2022/acorex-platform-module-auth-client-session-lock-overlay.component-DqXGuIgN.mjs +0 -346
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
import * as i1$1 from '@acorex/components/button';
|
|
2
|
+
import { AXButtonModule } from '@acorex/components/button';
|
|
3
|
+
import * as i1 from '@acorex/components/form';
|
|
4
|
+
import { AXFormModule } from '@acorex/components/form';
|
|
5
|
+
import * as i3 from '@acorex/components/label';
|
|
6
|
+
import { AXLabelModule } from '@acorex/components/label';
|
|
7
|
+
import * as i4 from '@acorex/components/password-box';
|
|
8
|
+
import { AXPasswordBoxModule } from '@acorex/components/password-box';
|
|
9
|
+
import { AXToastService } from '@acorex/components/toast';
|
|
10
|
+
import * as i7 from '@acorex/core/translation';
|
|
11
|
+
import { AXTranslationService, AXTranslationModule } from '@acorex/core/translation';
|
|
12
|
+
import * as i6 from '@angular/common';
|
|
13
|
+
import { CommonModule } from '@angular/common';
|
|
14
|
+
import { HttpClient } from '@angular/common/http';
|
|
15
|
+
import * as i0 from '@angular/core';
|
|
16
|
+
import { inject, Component } from '@angular/core';
|
|
17
|
+
import * as i1$2 from '@angular/router';
|
|
18
|
+
import { ActivatedRoute, Router, RouterModule } from '@angular/router';
|
|
19
|
+
import { firstValueFrom } from 'rxjs';
|
|
20
|
+
import { n as AXM_AUTH_CONFIG_TOKEN } from './acorex-platform-module-auth-client-acorex-platform-module-auth-client-mW7tx8C0.mjs';
|
|
21
|
+
|
|
22
|
+
class AXPResetPasswordComponent {
|
|
23
|
+
constructor() {
|
|
24
|
+
this.route = inject(ActivatedRoute);
|
|
25
|
+
this.router = inject(Router);
|
|
26
|
+
this.http = inject(HttpClient);
|
|
27
|
+
this.toast = inject(AXToastService);
|
|
28
|
+
this.translation = inject(AXTranslationService);
|
|
29
|
+
this.configs = inject(AXM_AUTH_CONFIG_TOKEN);
|
|
30
|
+
this.token = '';
|
|
31
|
+
this.newPassword = '';
|
|
32
|
+
this.confirmPassword = '';
|
|
33
|
+
this.submitting = false;
|
|
34
|
+
}
|
|
35
|
+
ngOnInit() {
|
|
36
|
+
this.token = this.route.snapshot.queryParamMap.get('token') ?? '';
|
|
37
|
+
}
|
|
38
|
+
async submit() {
|
|
39
|
+
if (this.submitting) {
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
const token = this.token.trim();
|
|
43
|
+
if (!token) {
|
|
44
|
+
const msg = await this.translation
|
|
45
|
+
.translateAsync('@auth:reset-password.invalid-link')
|
|
46
|
+
.catch(() => 'This password reset link is invalid.');
|
|
47
|
+
this.toast.show({ color: 'danger', title: msg, content: msg });
|
|
48
|
+
return;
|
|
49
|
+
}
|
|
50
|
+
if (!this.newPassword || this.newPassword.length < 6) {
|
|
51
|
+
const msg = await this.translation
|
|
52
|
+
.translateAsync('@auth:reset-password.password-too-short')
|
|
53
|
+
.catch(() => 'Password must be at least 6 characters.');
|
|
54
|
+
this.toast.show({ color: 'warning', title: msg, content: msg });
|
|
55
|
+
return;
|
|
56
|
+
}
|
|
57
|
+
if (this.newPassword !== this.confirmPassword) {
|
|
58
|
+
const msg = await this.translation
|
|
59
|
+
.translateAsync('@auth:reset-password.password-mismatch')
|
|
60
|
+
.catch(() => 'Passwords do not match.');
|
|
61
|
+
this.toast.show({ color: 'warning', title: msg, content: msg });
|
|
62
|
+
return;
|
|
63
|
+
}
|
|
64
|
+
this.submitting = true;
|
|
65
|
+
try {
|
|
66
|
+
const baseUrl = (this.configs.baseUrl ?? '').replace(/\/$/, '');
|
|
67
|
+
const result = await firstValueFrom(this.http.post(`${baseUrl}/v1/auth/password-reset/complete`, { token, newPassword: this.newPassword }));
|
|
68
|
+
if (!result?.success) {
|
|
69
|
+
throw new Error(result?.message || 'Reset failed');
|
|
70
|
+
}
|
|
71
|
+
const [title, content] = await Promise.all([
|
|
72
|
+
this.translation
|
|
73
|
+
.translateAsync('@auth:reset-password.success.title')
|
|
74
|
+
.catch(() => 'Password Updated'),
|
|
75
|
+
this.translation
|
|
76
|
+
.translateAsync('@auth:reset-password.success.description')
|
|
77
|
+
.catch(() => 'Your password has been updated. You can sign in now.'),
|
|
78
|
+
]);
|
|
79
|
+
this.toast.show({ color: 'success', title, content, timeOut: 4000 });
|
|
80
|
+
await this.router.navigate(['/auth/login']);
|
|
81
|
+
}
|
|
82
|
+
catch (error) {
|
|
83
|
+
const [title, fallbackContent] = await Promise.all([
|
|
84
|
+
this.translation
|
|
85
|
+
.translateAsync('@auth:reset-password.error.title')
|
|
86
|
+
.catch(() => 'Reset Failed'),
|
|
87
|
+
this.translation
|
|
88
|
+
.translateAsync('@auth:reset-password.error.description')
|
|
89
|
+
.catch(() => 'Unable to reset password. The link may have expired.'),
|
|
90
|
+
]);
|
|
91
|
+
const content = error instanceof Error && error.message ? error.message : fallbackContent;
|
|
92
|
+
this.toast.show({ color: 'danger', title, content, timeOut: 5000 });
|
|
93
|
+
}
|
|
94
|
+
finally {
|
|
95
|
+
this.submitting = false;
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPResetPasswordComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
|
|
99
|
+
static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "21.2.9", type: AXPResetPasswordComponent, isStandalone: true, selector: "ng-component", ngImport: i0, template: "<div class=\"text-center mb-4\">\n <h1 class=\"font-bold text-xl mb-2\">{{ '@auth:reset-password.title' | translate | async }}</h1>\n <p class=\"text-base text-neutral-600\">\n {{ '@auth:reset-password.hint' | translate | async }}\n </p>\n</div>\n<div class=\"w-80 lg:w-96\">\n <ax-form>\n <div class=\"flex flex-col gap-6\">\n <ax-form-field>\n <ax-label>{{ '@auth:reset-password.new-password' | translate | async }}</ax-label>\n <ax-password-box\n name=\"newPassword\"\n [(value)]=\"newPassword\"\n [disabled]=\"submitting\"\n ></ax-password-box>\n </ax-form-field>\n <ax-form-field>\n <ax-label>{{ '@auth:reset-password.confirm-password' | translate | async }}</ax-label>\n <ax-password-box\n name=\"confirmPassword\"\n [(value)]=\"confirmPassword\"\n [disabled]=\"submitting\"\n ></ax-password-box>\n </ax-form-field>\n </div>\n <ax-button\n color=\"primary\"\n class=\"mt-6 w-full\"\n [text]=\"'@auth:reset-password.submit' | translate | async\"\n [disabled]=\"submitting\"\n (onClick)=\"submit()\"\n ></ax-button>\n <div class=\"text-center mt-6 text-sm font-normal\">\n <a [routerLink]=\"['/auth/login']\" class=\"links font-semibold\">{{\n '@auth:signin.title' | translate | async\n }}</a>\n </div>\n </ax-form>\n</div>\n", dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "ngmodule", type: AXFormModule }, { kind: "component", type: i1.AXFormFieldComponent, selector: "ax-form-field", inputs: ["labelMode"] }, { kind: "component", type: i1.AXFormComponent, selector: "ax-form", inputs: ["disabled", "readonly", "labelMode", "look", "messageStyle", "updateOn", "inUserInteractionActive"], outputs: ["onValidate", "updateOnChange"] }, { kind: "ngmodule", type: AXPasswordBoxModule }, { kind: "component", type: i4.AXPasswordBoxComponent, selector: "ax-password-box", inputs: ["readonly", "disabled", "tabIndex", "placeholder", "value", "state", "name", "id", "look", "autoComplete", "showToggleButton", "class"], outputs: ["valueChange", "stateChange", "onValueChanged", "onBlur", "onFocus", "readonlyChange", "disabledChange", "onKeyDown", "onKeyUp", "onKeyPress"] }, { kind: "ngmodule", type: AXButtonModule }, { kind: "component", type: i1$1.AXButtonComponent, selector: "ax-button", inputs: ["disabled", "size", "tabIndex", "color", "look", "text", "toggleable", "selected", "iconOnly", "type", "loadingText"], outputs: ["onBlur", "onFocus", "onClick", "selectedChange", "toggleableChange", "lookChange", "colorChange", "disabledChange", "loadingTextChange"] }, { kind: "ngmodule", type: AXLabelModule }, { kind: "component", type: i3.AXLabelComponent, selector: "ax-label", inputs: ["required", "for"], outputs: ["requiredChange"] }, { kind: "ngmodule", type: AXTranslationModule }, { kind: "ngmodule", type: RouterModule }, { kind: "directive", type: i1$2.RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "pipe", type: i6.AsyncPipe, name: "async" }, { kind: "pipe", type: i7.AXTranslatorPipe, name: "translate" }] }); }
|
|
100
|
+
}
|
|
101
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "21.2.9", ngImport: i0, type: AXPResetPasswordComponent, decorators: [{
|
|
102
|
+
type: Component,
|
|
103
|
+
args: [{ imports: [
|
|
104
|
+
CommonModule,
|
|
105
|
+
AXFormModule,
|
|
106
|
+
AXPasswordBoxModule,
|
|
107
|
+
AXButtonModule,
|
|
108
|
+
AXLabelModule,
|
|
109
|
+
AXTranslationModule,
|
|
110
|
+
RouterModule,
|
|
111
|
+
], template: "<div class=\"text-center mb-4\">\n <h1 class=\"font-bold text-xl mb-2\">{{ '@auth:reset-password.title' | translate | async }}</h1>\n <p class=\"text-base text-neutral-600\">\n {{ '@auth:reset-password.hint' | translate | async }}\n </p>\n</div>\n<div class=\"w-80 lg:w-96\">\n <ax-form>\n <div class=\"flex flex-col gap-6\">\n <ax-form-field>\n <ax-label>{{ '@auth:reset-password.new-password' | translate | async }}</ax-label>\n <ax-password-box\n name=\"newPassword\"\n [(value)]=\"newPassword\"\n [disabled]=\"submitting\"\n ></ax-password-box>\n </ax-form-field>\n <ax-form-field>\n <ax-label>{{ '@auth:reset-password.confirm-password' | translate | async }}</ax-label>\n <ax-password-box\n name=\"confirmPassword\"\n [(value)]=\"confirmPassword\"\n [disabled]=\"submitting\"\n ></ax-password-box>\n </ax-form-field>\n </div>\n <ax-button\n color=\"primary\"\n class=\"mt-6 w-full\"\n [text]=\"'@auth:reset-password.submit' | translate | async\"\n [disabled]=\"submitting\"\n (onClick)=\"submit()\"\n ></ax-button>\n <div class=\"text-center mt-6 text-sm font-normal\">\n <a [routerLink]=\"['/auth/login']\" class=\"links font-semibold\">{{\n '@auth:signin.title' | translate | async\n }}</a>\n </div>\n </ax-form>\n</div>\n" }]
|
|
112
|
+
}] });
|
|
113
|
+
|
|
114
|
+
export { AXPResetPasswordComponent };
|
|
115
|
+
//# sourceMappingURL=acorex-platform-module-auth-client-reset-password.component-CTlrt_18.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-auth-client-reset-password.component-CTlrt_18.mjs","sources":["../../../../libs/modules/auth/client/src/lib/pages/reset-password/reset-password.component.ts","../../../../libs/modules/auth/client/src/lib/pages/reset-password/reset-password.component.html"],"sourcesContent":["import { AXButtonModule } from '@acorex/components/button';\nimport { AXFormModule } from '@acorex/components/form';\nimport { AXLabelModule } from '@acorex/components/label';\nimport { AXPasswordBoxModule } from '@acorex/components/password-box';\nimport { AXToastService } from '@acorex/components/toast';\nimport { AXTranslationModule, AXTranslationService } from '@acorex/core/translation';\nimport { CommonModule } from '@angular/common';\nimport { HttpClient } from '@angular/common/http';\nimport { Component, inject, OnInit } from '@angular/core';\nimport { ActivatedRoute, Router, RouterModule } from '@angular/router';\nimport { firstValueFrom } from 'rxjs';\nimport { AXMAuthConfigs, AXM_AUTH_CONFIG_TOKEN } from '../../auth.config';\n\n@Component({\n templateUrl: './reset-password.component.html',\n imports: [\n CommonModule,\n AXFormModule,\n AXPasswordBoxModule,\n AXButtonModule,\n AXLabelModule,\n AXTranslationModule,\n RouterModule,\n ],\n})\nexport class AXPResetPasswordComponent implements OnInit {\n private readonly route = inject(ActivatedRoute);\n private readonly router = inject(Router);\n private readonly http = inject(HttpClient);\n private readonly toast = inject(AXToastService);\n private readonly translation = inject(AXTranslationService);\n private readonly configs = inject<AXMAuthConfigs>(AXM_AUTH_CONFIG_TOKEN);\n\n protected token = '';\n protected newPassword = '';\n protected confirmPassword = '';\n protected submitting = false;\n\n ngOnInit(): void {\n this.token = this.route.snapshot.queryParamMap.get('token') ?? '';\n }\n\n protected async submit(): Promise<void> {\n if (this.submitting) {\n return;\n }\n\n const token = this.token.trim();\n if (!token) {\n const msg = await this.translation\n .translateAsync('@auth:reset-password.invalid-link')\n .catch(() => 'This password reset link is invalid.');\n this.toast.show({ color: 'danger', title: msg, content: msg });\n return;\n }\n\n if (!this.newPassword || this.newPassword.length < 6) {\n const msg = await this.translation\n .translateAsync('@auth:reset-password.password-too-short')\n .catch(() => 'Password must be at least 6 characters.');\n this.toast.show({ color: 'warning', title: msg, content: msg });\n return;\n }\n\n if (this.newPassword !== this.confirmPassword) {\n const msg = await this.translation\n .translateAsync('@auth:reset-password.password-mismatch')\n .catch(() => 'Passwords do not match.');\n this.toast.show({ color: 'warning', title: msg, content: msg });\n return;\n }\n\n this.submitting = true;\n try {\n const baseUrl = (this.configs.baseUrl ?? '').replace(/\\/$/, '');\n const result = await firstValueFrom(\n this.http.post<{ success: boolean; message?: string }>(\n `${baseUrl}/v1/auth/password-reset/complete`,\n { token, newPassword: this.newPassword },\n ),\n );\n\n if (!result?.success) {\n throw new Error(result?.message || 'Reset failed');\n }\n\n const [title, content] = await Promise.all([\n this.translation\n .translateAsync('@auth:reset-password.success.title')\n .catch(() => 'Password Updated'),\n this.translation\n .translateAsync('@auth:reset-password.success.description')\n .catch(() => 'Your password has been updated. You can sign in now.'),\n ]);\n this.toast.show({ color: 'success', title, content, timeOut: 4000 });\n await this.router.navigate(['/auth/login']);\n } catch (error) {\n const [title, fallbackContent] = await Promise.all([\n this.translation\n .translateAsync('@auth:reset-password.error.title')\n .catch(() => 'Reset Failed'),\n this.translation\n .translateAsync('@auth:reset-password.error.description')\n .catch(() => 'Unable to reset password. The link may have expired.'),\n ]);\n const content =\n error instanceof Error && error.message ? error.message : fallbackContent;\n this.toast.show({ color: 'danger', title, content, timeOut: 5000 });\n } finally {\n this.submitting = false;\n }\n }\n}\n","<div class=\"text-center mb-4\">\n <h1 class=\"font-bold text-xl mb-2\">{{ '@auth:reset-password.title' | translate | async }}</h1>\n <p class=\"text-base text-neutral-600\">\n {{ '@auth:reset-password.hint' | translate | async }}\n </p>\n</div>\n<div class=\"w-80 lg:w-96\">\n <ax-form>\n <div class=\"flex flex-col gap-6\">\n <ax-form-field>\n <ax-label>{{ '@auth:reset-password.new-password' | translate | async }}</ax-label>\n <ax-password-box\n name=\"newPassword\"\n [(value)]=\"newPassword\"\n [disabled]=\"submitting\"\n ></ax-password-box>\n </ax-form-field>\n <ax-form-field>\n <ax-label>{{ '@auth:reset-password.confirm-password' | translate | async }}</ax-label>\n <ax-password-box\n name=\"confirmPassword\"\n [(value)]=\"confirmPassword\"\n [disabled]=\"submitting\"\n ></ax-password-box>\n </ax-form-field>\n </div>\n <ax-button\n color=\"primary\"\n class=\"mt-6 w-full\"\n [text]=\"'@auth:reset-password.submit' | translate | async\"\n [disabled]=\"submitting\"\n (onClick)=\"submit()\"\n ></ax-button>\n <div class=\"text-center mt-6 text-sm font-normal\">\n <a [routerLink]=\"['/auth/login']\" class=\"links font-semibold\">{{\n '@auth:signin.title' | translate | async\n }}</a>\n </div>\n </ax-form>\n</div>\n"],"names":["i2","i3","i4","i5"],"mappings":";;;;;;;;;;;;;;;;;;;;;MAyBa,yBAAyB,CAAA;AAZtC,IAAA,WAAA,GAAA;AAamB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,QAAA,IAAA,CAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AACvB,QAAA,IAAA,CAAA,IAAI,GAAG,MAAM,CAAC,UAAU,CAAC;AACzB,QAAA,IAAA,CAAA,KAAK,GAAG,MAAM,CAAC,cAAc,CAAC;AAC9B,QAAA,IAAA,CAAA,WAAW,GAAG,MAAM,CAAC,oBAAoB,CAAC;AAC1C,QAAA,IAAA,CAAA,OAAO,GAAG,MAAM,CAAiB,qBAAqB,CAAC;QAE9D,IAAA,CAAA,KAAK,GAAG,EAAE;QACV,IAAA,CAAA,WAAW,GAAG,EAAE;QAChB,IAAA,CAAA,eAAe,GAAG,EAAE;QACpB,IAAA,CAAA,UAAU,GAAG,KAAK;AA4E7B,IAAA;IA1EC,QAAQ,GAAA;AACN,QAAA,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,aAAa,CAAC,GAAG,CAAC,OAAO,CAAC,IAAI,EAAE;IACnE;AAEU,IAAA,MAAM,MAAM,GAAA;AACpB,QAAA,IAAI,IAAI,CAAC,UAAU,EAAE;YACnB;QACF;QAEA,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE;QAC/B,IAAI,CAAC,KAAK,EAAE;AACV,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AAA,EAAA,EAAA,CAAA,SAAA,EAAA,IAAA,EAAA,OAAA,EAAA,EAAA,EAAA,IAAA,EAAA,MAAA,EAAA,IAAA,EAAA,EAAA,CAAA,gBAAA,EAAA,IAAA,EAAA,WAAA,EAAA,CAAA,EAAA,CAAA,CAAA;;2FAGH,yBAAyB,EAAA,UAAA,EAAA,CAAA;kBAZrC,SAAS;AAEC,YAAA,IAAA,EAAA,CAAA,EAAA,OAAA,EAAA;wBACP,YAAY;wBACZ,YAAY;wBACZ,mBAAmB;wBACnB,cAAc;wBACd,aAAa;wBACb,mBAAmB;wBACnB,YAAY;AACb,qBAAA,EAAA,QAAA,EAAA,u4CAAA,EAAA;;;;;"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
var routes = [
|
|
2
|
+
{
|
|
3
|
+
path: 'forgot',
|
|
4
|
+
loadComponent: () => import('./acorex-platform-module-auth-client-password.component-DnFItGdA.mjs').then((c) => c.AXPForgetPasswordComponent),
|
|
5
|
+
},
|
|
6
|
+
{
|
|
7
|
+
path: 'reset-password',
|
|
8
|
+
loadComponent: () => import('./acorex-platform-module-auth-client-reset-password.component-CTlrt_18.mjs').then((c) => c.AXPResetPasswordComponent),
|
|
9
|
+
},
|
|
10
|
+
];
|
|
11
|
+
|
|
12
|
+
export { routes as default };
|
|
13
|
+
//# sourceMappingURL=acorex-platform-module-auth-client-routes-DVN2Y2Ps.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"acorex-platform-module-auth-client-routes-DVN2Y2Ps.mjs","sources":["../../../../libs/modules/auth/client/src/lib/pages/forgot/routes.ts"],"sourcesContent":["import { Route } from '@angular/router';\n\nexport default [\n {\n path: 'forgot',\n loadComponent: () =>\n import('./password/password.component').then((c) => c.AXPForgetPasswordComponent),\n },\n {\n path: 'reset-password',\n loadComponent: () =>\n import('../reset-password/reset-password.component').then((c) => c.AXPResetPasswordComponent),\n },\n] as Route[];\n"],"names":[],"mappings":"AAEA,aAAe;AACb,IAAA;AACE,QAAA,IAAI,EAAE,QAAQ;AACd,QAAA,aAAa,EAAE,MACb,OAAO,sEAA+B,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,0BAA0B,CAAC;AACpF,KAAA;AACD,IAAA;AACE,QAAA,IAAI,EAAE,gBAAgB;AACtB,QAAA,aAAa,EAAE,MACb,OAAO,4EAA4C,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,yBAAyB,CAAC;AAChG,KAAA;CACS;;;;"}
|