@flusys/ng-auth 9.1.0-rc.1 → 9.1.1
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/README.md +2 -0
- package/fesm2022/flusys-ng-auth-administration-page.component-DmN4KqiR.mjs +146 -0
- package/fesm2022/flusys-ng-auth-administration-page.component-DmN4KqiR.mjs.map +1 -0
- package/fesm2022/flusys-ng-auth-branch-form.component-Df_sMC2G.mjs +743 -0
- package/fesm2022/flusys-ng-auth-branch-form.component-Df_sMC2G.mjs.map +1 -0
- package/fesm2022/flusys-ng-auth-branch-list.component-CWat6QWN.mjs +775 -0
- package/fesm2022/flusys-ng-auth-branch-list.component-CWat6QWN.mjs.map +1 -0
- package/fesm2022/flusys-ng-auth-company-form.component-BvZ4Pn8j.mjs +198 -0
- package/fesm2022/flusys-ng-auth-company-form.component-BvZ4Pn8j.mjs.map +1 -0
- package/fesm2022/flusys-ng-auth-company-list.component-Corh9AIh.mjs +241 -0
- package/fesm2022/flusys-ng-auth-company-list.component-Corh9AIh.mjs.map +1 -0
- package/fesm2022/flusys-ng-auth-extension-order.util-2XWSLqii.mjs +6 -0
- package/fesm2022/flusys-ng-auth-extension-order.util-2XWSLqii.mjs.map +1 -0
- package/fesm2022/flusys-ng-auth-forgot-password-page.component-BRTVZPX6.mjs +384 -0
- package/fesm2022/flusys-ng-auth-forgot-password-page.component-BRTVZPX6.mjs.map +1 -0
- package/fesm2022/flusys-ng-auth-login-page.component-DQl52Qau.mjs +1074 -0
- package/fesm2022/flusys-ng-auth-login-page.component-DQl52Qau.mjs.map +1 -0
- package/fesm2022/flusys-ng-auth-profile-page.component-b-8rPEXQ.mjs +1792 -0
- package/fesm2022/flusys-ng-auth-profile-page.component-b-8rPEXQ.mjs.map +1 -0
- package/fesm2022/flusys-ng-auth-register-page.component-D99y1jiA.mjs +1513 -0
- package/fesm2022/flusys-ng-auth-register-page.component-D99y1jiA.mjs.map +1 -0
- package/fesm2022/flusys-ng-auth-reset-password-page.component-C0tN_AW1.mjs +538 -0
- package/fesm2022/flusys-ng-auth-reset-password-page.component-C0tN_AW1.mjs.map +1 -0
- package/fesm2022/flusys-ng-auth-social-callback-page.component-gTD7_LJY.mjs +217 -0
- package/fesm2022/flusys-ng-auth-social-callback-page.component-gTD7_LJY.mjs.map +1 -0
- package/fesm2022/flusys-ng-auth-social-config-page.component-DpGmcb9n.mjs +541 -0
- package/fesm2022/flusys-ng-auth-social-config-page.component-DpGmcb9n.mjs.map +1 -0
- package/fesm2022/flusys-ng-auth-user-form.component-CM9UYc0q.mjs +1171 -0
- package/fesm2022/flusys-ng-auth-user-form.component-CM9UYc0q.mjs.map +1 -0
- package/fesm2022/flusys-ng-auth-user-list.component-Bew7gz-H.mjs +1046 -0
- package/fesm2022/flusys-ng-auth-user-list.component-Bew7gz-H.mjs.map +1 -0
- package/fesm2022/flusys-ng-auth-verify-email-page.component-DB9iKvt3.mjs +545 -0
- package/fesm2022/flusys-ng-auth-verify-email-page.component-DB9iKvt3.mjs.map +1 -0
- package/fesm2022/flusys-ng-auth.mjs +3030 -10735
- package/fesm2022/flusys-ng-auth.mjs.map +1 -1
- package/package.json +5 -5
- package/types/flusys-ng-auth.d.ts +978 -1558
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"flusys-ng-auth-register-page.component-D99y1jiA.mjs","names":[],"sources":["../../../projects/ng-auth/pages/register/register-page.component.ts"],"sourcesContent":["import {\n Component,\n computed,\n DestroyRef,\n effect,\n inject,\n Injector,\n input,\n signal,\n} from '@angular/core';\nimport { takeUntilDestroyed, toSignal } from '@angular/core/rxjs-interop';\nimport { NgComponentOutlet, NgTemplateOutlet } from '@angular/common';\nimport { FormsModule } from '@angular/forms';\nimport {\n form,\n FormField,\n minLength,\n required,\n} from '@angular/forms/signals';\nimport { ActivatedRoute, Router, RouterLink } from '@angular/router';\nimport {\n APP_CONFIG,\n getDefaultBranchSlug,\n getDefaultCompanySlug,\n isCompanyFeatureEnabled,\n} from '@flusys/ng-core';\nimport { AppFloatingConfigurator } from '@flusys/ng-layout';\nimport {\n TranslatePipe,\n TranslateService,\n} from '@flusys/ng-shared';\nimport {\n CheckboxComponent,\n FButtonDirective,\n InputTextDirective,\n MessageService,\n PasswordComponent,\n SelectComponent,\n TextareaDirective,\n UiIconComponent,\n} from '@flusys/ng-ui';\nimport { IRegistrationRequest } from '../../interfaces/auth.interface';\nimport {\n AUTH_REGISTRATION_EXTENSION,\n IRegistrationExtraField,\n IRegistrationFieldTemplateContext,\n REGISTRATION_FIELD_CONTEXT,\n} from '../../providers/auth-extension.providers';\nimport { sortByOrder } from '../../providers/extension-order.util';\nimport { AuthApiService } from '../../services/auth-api.service';\nimport { AuthStateService } from '../../services/auth-state.service';\nimport { EmailPolicyService } from '../../services/email-policy.service';\nimport { PasswordPolicyService } from '../../services/password-policy.service';\n\ninterface IUserFormModel {\n name: string;\n email: string;\n password: string;\n confirmPassword: string;\n phone: string;\n}\n\ninterface ICompanyFormModel {\n createNewCompany: boolean;\n companySlug: string;\n branchSlug: string;\n newCompanyName: string;\n newCompanyPhone: string;\n newCompanyAddress: string;\n}\n\n@Component({\n selector: 'lib-register-page',\n imports: [\n CheckboxComponent,\n FButtonDirective,\n InputTextDirective,\n PasswordComponent,\n SelectComponent,\n TextareaDirective,\n UiIconComponent,\n FormsModule,\n NgComponentOutlet,\n NgTemplateOutlet,\n RouterLink,\n FormField,\n AppFloatingConfigurator,\n TranslatePipe,\n ],\n template: `\n <app-floating-configurator />\n <div\n class=\"bg-surface-ground flex items-center justify-center min-h-screen py-8\"\n >\n <div class=\"flex flex-col items-center justify-center\">\n <div\n style=\"border-radius: var(--f-content-border-radius); padding: 0.3rem; background: linear-gradient(180deg, var(--primary-color) 10%, rgba(33, 150, 243, 0) 30%)\"\n >\n <div\n class=\"py-8 px-4 sm:py-10 sm:px-8 md:py-12 md:px-12 w-full sm:w-[650px] max-w-[95vw] sm:max-w-[90vw]\"\n style=\"border-radius: var(--f-content-border-radius); background: var(--f-content-background)\"\n >\n <div class=\"text-center mb-6\">\n <div class=\"text-3xl font-medium mb-4 text-color\">\n {{ 'auth.register.create.account' | translate }}\n </div>\n <span class=\"text-muted-color font-medium\">{{\n 'auth.register.subtitle' | translate\n }}</span>\n </div>\n\n <form (ngSubmit)=\"onSubmit()\">\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4\">\n <div>\n <label for=\"name\" class=\"block font-medium mb-2\"\n >{{ 'auth.register.full.name' | translate }} *</label\n >\n <input\n fInputText\n id=\"name\"\n [formField]=\"userForm.name\"\n [placeholder]=\"'auth.register.name.placeholder' | translate\"\n class=\"w-full\"\n autocomplete=\"name\"\n />\n </div>\n\n <div>\n <label for=\"phone\" class=\"block font-medium mb-2\">{{\n 'auth.phone.label' | translate\n }}</label>\n <input\n fInputText\n id=\"phone\"\n [formField]=\"userForm.phone\"\n [placeholder]=\"'auth.phone.placeholder' | translate\"\n class=\"w-full\"\n autocomplete=\"tel\"\n />\n </div>\n </div>\n\n <div class=\"mb-4\">\n <label for=\"email\" class=\"block font-medium mb-2\"\n >{{ 'auth.email.label' | translate }} *</label\n >\n <input\n fInputText\n id=\"email\"\n type=\"email\"\n [formField]=\"userForm.email\"\n [placeholder]=\"'auth.email.placeholder' | translate\"\n class=\"w-full\"\n autocomplete=\"email\"\n />\n @if (emailValidationError()) {\n <small class=\"text-danger block mt-1\">{{\n emailValidationError()\n }}</small>\n }\n </div>\n\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4\">\n <div>\n <label for=\"password\" class=\"block font-medium mb-2\"\n >{{ 'auth.password.label' | translate }} *</label\n >\n <f-password\n [inputId]=\"'password'\"\n [formField]=\"userForm.password\"\n [placeholder]=\"\n 'shared.min.characters'\n | translate: { count: passwordPolicy.minLength }\n \"\n class=\"w-full\"\n autocomplete=\"new-password\"\n />\n @if (passwordValidationError()) {\n <small class=\"text-danger block mt-1\">{{\n passwordValidationError()\n }}</small>\n }\n </div>\n\n <div>\n <label for=\"confirmPassword\" class=\"block font-medium mb-2\"\n >{{ 'auth.register.confirm.password' | translate }} *</label\n >\n <f-password\n [inputId]=\"'confirmPassword'\"\n [formField]=\"userForm.confirmPassword\"\n [placeholder]=\"\n 'auth.register.confirm.password.placeholder' | translate\n \"\n class=\"w-full\"\n autocomplete=\"new-password\"\n />\n @if (!passwordsMatch() && userFormModel().confirmPassword) {\n <small class=\"text-danger block mt-2\">{{\n 'auth.register.passwords.do.not.match' | translate\n }}</small>\n }\n </div>\n </div>\n\n @if (extraFields().length > 0) {\n <div class=\"border-t border-surface pt-4 mt-4 mb-4\">\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4\">\n @for (field of extraFields(); track field.key) {\n <div [class]=\"field.containerClass ?? ''\">\n <label [for]=\"field.key\" class=\"block font-medium mb-2\">\n {{ field.labelKey | translate: null : field.label\n }}{{ field.required ? ' *' : '' }}\n </label>\n @if (field.component) {\n <ng-container\n [ngComponentOutlet]=\"field.component\"\n [ngComponentOutletInjector]=\"getFieldInjector(field)\"\n ></ng-container>\n } @else if (field.template) {\n <ng-container\n [ngTemplateOutlet]=\"field.template\"\n [ngTemplateOutletContext]=\"\n getFieldTemplateContext(field)\n \"\n ></ng-container>\n } @else {\n @switch (field.type) {\n @case ('text') {\n <input\n fInputText\n [id]=\"field.key\"\n [placeholder]=\"\n field.placeholderKey\n | translate: null : field.placeholder ?? ''\n \"\n [value]=\"\n extraFieldsModel()[field.key] ??\n field.defaultValue ??\n ''\n \"\n (input)=\"\n updateExtraField(\n field.key,\n $any($event.target).value\n )\n \"\n class=\"w-full\"\n />\n }\n @case ('number') {\n <input\n fInputText\n type=\"number\"\n [id]=\"field.key\"\n [placeholder]=\"\n field.placeholderKey\n | translate: null : field.placeholder ?? ''\n \"\n [value]=\"\n extraFieldsModel()[field.key] ??\n field.defaultValue ??\n ''\n \"\n (input)=\"\n updateExtraField(\n field.key,\n $any($event.target).valueAsNumber\n )\n \"\n class=\"w-full\"\n />\n }\n @case ('textarea') {\n <textarea\n fTextarea\n [id]=\"field.key\"\n [placeholder]=\"\n field.placeholderKey\n | translate: null : field.placeholder ?? ''\n \"\n [value]=\"\n extraFieldsModel()[field.key] ??\n field.defaultValue ??\n ''\n \"\n (input)=\"\n updateExtraField(\n field.key,\n $any($event.target).value\n )\n \"\n class=\"w-full\"\n rows=\"3\"\n ></textarea>\n }\n @case ('select') {\n <f-select\n [id]=\"field.key\"\n class=\"w-full\"\n [options]=\"field.options ?? []\"\n optionValue=\"value\"\n [ngModel]=\"\n extraFieldsModel()[field.key] ??\n field.defaultValue ??\n ''\n \"\n [ngModelOptions]=\"{ standalone: true }\"\n (ngModelChange)=\"\n updateExtraField(field.key, $event)\n \"\n [placeholder]=\"\n field.placeholderKey\n | translate\n : null\n : field.placeholder ??\n ('shared.select' | translate)\n \"\n >\n <ng-template #item let-opt>{{\n opt.labelKey | translate: null : opt.label\n }}</ng-template>\n <ng-template #selectedItem let-opt>{{\n opt.labelKey | translate: null : opt.label\n }}</ng-template>\n </f-select>\n }\n @case ('checkbox') {\n <f-checkbox\n [inputId]=\"field.key\"\n [checked]=\"\n $any(\n extraFieldsModel()[field.key] ??\n field.defaultValue ??\n false\n )\n \"\n (onChange)=\"\n updateExtraField(field.key, $event.checked)\n \"\n [label]=\"\n field.placeholderKey\n | translate\n : null\n : field.placeholder ??\n (field.labelKey\n | translate: null : field.label)\n \"\n />\n }\n @case ('date') {\n <input\n fInputText\n type=\"date\"\n [id]=\"field.key\"\n [value]=\"\n extraFieldsModel()[field.key] ??\n field.defaultValue ??\n ''\n \"\n (input)=\"\n updateExtraField(\n field.key,\n $any($event.target).value\n )\n \"\n class=\"w-full\"\n />\n }\n }\n }\n </div>\n }\n </div>\n @if (extraFieldsValidationError()) {\n <small class=\"text-danger block mt-2\">{{\n extraFieldsValidationError()\n }}</small>\n }\n </div>\n }\n\n @if (companyFeatureEnabled()) {\n <div class=\"border-t border-surface pt-6 mt-6\">\n <div class=\"text-center mb-6\">\n <div class=\"text-2xl font-medium mb-2 text-color\">\n {{ 'auth.register.company.details' | translate }}\n </div>\n <span class=\"text-muted-color font-medium\">\n @if (hasDefaultCompany()) {\n {{ 'auth.register.join.default.company' | translate }}\n } @else {\n {{ 'auth.register.join.or.create.company' | translate }}\n }\n </span>\n </div>\n\n @if (!hasDefaultCompany()) {\n <div class=\"mb-4\">\n <f-checkbox\n [formField]=\"companyForm.createNewCompany\"\n [label]=\"'auth.register.create.new.company' | translate\"\n (onChange)=\"onCreateCompanyToggle($event.checked)\"\n />\n </div>\n }\n\n @if (!companyFormModel().createNewCompany) {\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4\">\n <div>\n <label\n for=\"companySlug\"\n class=\"block font-medium mb-2\"\n >{{ 'auth.register.company.code' | translate }}</label\n >\n @if (hasDefaultCompany()) {\n <input\n fInputText\n id=\"companySlug\"\n [value]=\"defaultCompanySlug()\"\n class=\"w-full bg-(--f-form-field-filled-background)\"\n readonly\n />\n <small class=\"text-muted-color\">{{\n 'auth.register.preconfigured.company' | translate\n }}</small>\n } @else {\n <input\n fInputText\n id=\"companySlug\"\n [formField]=\"companyForm.companySlug\"\n [placeholder]=\"\n 'auth.register.company.code.placeholder'\n | translate\n \"\n class=\"w-full\"\n />\n <small class=\"text-muted-color\">{{\n 'auth.register.enter.company.code' | translate\n }}</small>\n }\n </div>\n\n <div>\n <label\n for=\"branchSlug\"\n class=\"block font-medium mb-2\"\n >{{ 'auth.register.branch.code' | translate }}</label\n >\n @if (hasDefaultBranch()) {\n <input\n fInputText\n id=\"branchSlug\"\n [value]=\"defaultBranchSlug()\"\n class=\"w-full bg-(--f-form-field-filled-background)\"\n readonly\n />\n <small class=\"text-muted-color\">{{\n 'auth.register.preconfigured.branch' | translate\n }}</small>\n } @else {\n <input\n fInputText\n id=\"branchSlug\"\n [formField]=\"companyForm.branchSlug\"\n [placeholder]=\"\n 'auth.register.branch.code.placeholder'\n | translate\n \"\n class=\"w-full\"\n />\n }\n </div>\n </div>\n } @else {\n <div class=\"mb-4\">\n <label for=\"newCompanyName\" class=\"block font-medium mb-2\"\n >{{ 'auth.register.company.name' | translate }} *</label\n >\n <input\n fInputText\n id=\"newCompanyName\"\n [formField]=\"companyForm.newCompanyName\"\n [placeholder]=\"\n 'auth.register.company.name.placeholder' | translate\n \"\n class=\"w-full\"\n />\n </div>\n\n <div class=\"grid grid-cols-1 md:grid-cols-2 gap-4 mb-4\">\n <div>\n <label\n for=\"newCompanyPhone\"\n class=\"block font-medium mb-2\"\n >{{ 'auth.phone.label' | translate }}</label\n >\n <input\n fInputText\n id=\"newCompanyPhone\"\n [formField]=\"companyForm.newCompanyPhone\"\n [placeholder]=\"'auth.phone.placeholder' | translate\"\n class=\"w-full\"\n />\n </div>\n\n <div>\n <label\n for=\"newCompanyAddress\"\n class=\"block font-medium mb-2\"\n >{{ 'auth.address.label' | translate }}</label\n >\n <input\n fInputText\n id=\"newCompanyAddress\"\n [formField]=\"companyForm.newCompanyAddress\"\n [placeholder]=\"'auth.address.placeholder' | translate\"\n class=\"w-full\"\n />\n </div>\n </div>\n }\n </div>\n }\n\n <button\n fButton\n class=\"w-full mt-4\"\n type=\"submit\"\n [disabled]=\"!isFormValid() || isLoading()\"\n >\n @if (isLoading()) {\n <ui-icon pButtonIcon name=\"spinner\" [spin]=\"true\"></ui-icon>\n }\n <span pButtonLabel>{{\n 'auth.register.create.account' | translate\n }}</span>\n </button>\n\n <div class=\"flex items-center justify-center mt-4 gap-2\">\n <span class=\"font-medium\">{{\n 'auth.register.already.have.account' | translate\n }}</span>\n <a\n routerLink=\"/auth/login\"\n class=\"font-semibold text-primary cursor-pointer\"\n >\n {{ 'auth.login.sign.in' | translate }}\n </a>\n </div>\n </form>\n </div>\n </div>\n </div>\n </div>\n `,\n})\nexport class RegisterPageComponent {\n private readonly destroyRef = inject(DestroyRef);\n private readonly appConfig = inject(APP_CONFIG);\n private readonly messageService = inject(MessageService);\n private readonly authApi = inject(AuthApiService);\n private readonly authState = inject(AuthStateService);\n private readonly route = inject(ActivatedRoute);\n private readonly router = inject(Router);\n\n private readonly emailPolicy = inject(EmailPolicyService);\n protected readonly passwordPolicy = inject(PasswordPolicyService);\n private readonly registrationExtension = inject(AUTH_REGISTRATION_EXTENSION, {\n optional: true,\n });\n private readonly translateAdapter = inject(TranslateService, {\n optional: true,\n });\n\n private translate(\n key: string,\n vars?: Record<string, unknown>,\n ): string {\n return this.translateAdapter?.translate(key, vars) ?? key;\n }\n\n private readonly queryParamMap = toSignal(this.route.queryParamMap);\n private companySlugInitialized = false;\n\n readonly returnUrl = input<string>('');\n readonly isLoading = signal(false);\n readonly companyFeatureEnabled = computed(() =>\n isCompanyFeatureEnabled(this.appConfig),\n );\n readonly defaultCompanySlug = computed(() =>\n getDefaultCompanySlug(this.appConfig),\n );\n readonly defaultBranchSlug = computed(() =>\n getDefaultBranchSlug(this.appConfig),\n );\n readonly hasDefaultCompany = computed(() => !!this.defaultCompanySlug());\n readonly hasDefaultBranch = computed(() => !!this.defaultBranchSlug());\n\n readonly extraFields = computed<IRegistrationExtraField[]>(() => {\n if (!this.registrationExtension) return [];\n return sortByOrder(this.registrationExtension.getExtraFields());\n });\n\n readonly extraFieldsModel = signal<Record<string, unknown>>(\n this.extraFields().reduce<Record<string, unknown>>((acc, field) => {\n if (field.defaultValue !== undefined) {\n acc[field.key] = field.defaultValue;\n }\n return acc;\n }, {}),\n );\n\n readonly userFormModel = signal<IUserFormModel>({\n name: '',\n email: '',\n password: '',\n confirmPassword: '',\n phone: '',\n });\n readonly userForm = form(this.userFormModel, (f) => {\n required(f.name, {\n message: this.translate('shared.name.required'),\n });\n minLength(f.name, 2, {\n message: this.translate('auth.validation.name.min.length', { min: 2 }),\n });\n required(f.email, {\n message: this.translate('auth.validation.email.required'),\n });\n required(f.password, {\n message: this.translate('auth.validation.password.required'),\n });\n required(f.confirmPassword, {\n message: this.translate('auth.validation.confirm.password.required'),\n });\n });\n\n readonly companyFormModel = signal<ICompanyFormModel>({\n createNewCompany: false,\n companySlug: '',\n branchSlug: '',\n newCompanyName: '',\n newCompanyPhone: '',\n newCompanyAddress: '',\n });\n readonly companyForm = form(this.companyFormModel);\n\n readonly emailValidationError = computed(() =>\n this.emailPolicy.validate(this.userFormModel().email),\n );\n\n readonly passwordValidationError = computed(() =>\n this.passwordPolicy.validate(this.userFormModel().password),\n );\n\n readonly extraFieldsValidationError = computed(() => {\n if (!this.registrationExtension?.validateExtraFields) return null;\n return this.registrationExtension.validateExtraFields(\n this.extraFieldsModel(),\n );\n });\n\n readonly passwordsMatch = computed(() => {\n const model = this.userFormModel();\n return model.password === model.confirmPassword;\n });\n\n readonly isFormValid = computed(() => {\n const userModel = this.userFormModel();\n const emailError = this.emailValidationError();\n const passwordError = this.passwordValidationError();\n const extraFieldsError = this.extraFieldsValidationError();\n\n const userValid =\n userModel.name.trim().length >= 2 &&\n userModel.email.includes('@') &&\n !emailError &&\n userModel.password.length > 0 &&\n !passwordError &&\n userModel.confirmPassword.length > 0 &&\n this.passwordsMatch() &&\n !extraFieldsError;\n\n const extraFieldsValid = this.validateRequiredExtraFields();\n\n if (!isCompanyFeatureEnabled(this.appConfig))\n return userValid && extraFieldsValid;\n\n const companyModel = this.companyFormModel();\n if (companyModel.createNewCompany) {\n return (\n userValid &&\n extraFieldsValid &&\n companyModel.newCompanyName.trim().length > 0\n );\n }\n return userValid && extraFieldsValid;\n });\n\n private validateRequiredExtraFields(): boolean {\n const fields = this.extraFields();\n const values = this.extraFieldsModel();\n\n for (const field of fields) {\n if (field.required) {\n const value = values[field.key];\n if (value === undefined || value === null || value === '') {\n return false;\n }\n }\n }\n return true;\n }\n\n updateExtraField(key: string, value: unknown): void {\n this.extraFieldsModel.update((model) => ({ ...model, [key]: value }));\n }\n\n getFieldTemplateContext(\n field: IRegistrationExtraField,\n ): IRegistrationFieldTemplateContext {\n return {\n field,\n value: this.extraFieldsModel()[field.key] ?? field.defaultValue,\n updateValue: (value: unknown) => this.updateExtraField(field.key, value),\n };\n }\n\n private readonly parentInjector = inject(Injector);\n\n private readonly fieldInjectors = new Map<\n string,\n { injector: Injector; setField: (field: IRegistrationExtraField) => void }\n >();\n\n getFieldInjector(field: IRegistrationExtraField): Injector {\n const cached = this.fieldInjectors.get(field.key);\n if (cached) {\n cached.setField(field);\n return cached.injector;\n }\n\n let currentField = field;\n const extraFieldsModel = this.extraFieldsModel;\n const context: IRegistrationFieldTemplateContext = {\n get field() {\n return currentField;\n },\n get value() {\n return extraFieldsModel()[currentField.key] ?? currentField.defaultValue;\n },\n updateValue: (value: unknown) =>\n this.updateExtraField(currentField.key, value),\n };\n\n const injector = Injector.create({\n providers: [{ provide: REGISTRATION_FIELD_CONTEXT, useValue: context }],\n parent: field.injector ?? this.parentInjector,\n });\n this.fieldInjectors.set(field.key, {\n injector,\n setField: (next) => (currentField = next),\n });\n return injector;\n }\n\n constructor() {\n effect(() => {\n const params = this.queryParamMap();\n if (!params || this.companySlugInitialized) return;\n\n this.companySlugInitialized = true;\n\n const configCompanySlug = this.defaultCompanySlug();\n const configBranchSlug = this.defaultBranchSlug();\n const queryCompanySlug = params.get('companySlug');\n\n const companySlug = configCompanySlug || queryCompanySlug || '';\n const branchSlug = configBranchSlug || '';\n\n if (companySlug || branchSlug) {\n this.companyFormModel.update((model) => ({\n ...model,\n companySlug,\n branchSlug,\n }));\n }\n });\n }\n\n onCreateCompanyToggle(createNew: boolean): void {\n if (createNew) {\n this.companyFormModel.update((model) => ({\n ...model,\n createNewCompany: true,\n companySlug: '',\n branchSlug: '',\n }));\n } else {\n this.companyFormModel.update((model) => ({\n ...model,\n createNewCompany: false,\n newCompanyName: '',\n newCompanyPhone: '',\n newCompanyAddress: '',\n }));\n }\n }\n\n onSubmit(): void {\n if (!this.isFormValid()) {\n this.messageService.add({\n severity: 'error',\n summary: this.translate('shared.validation.error'),\n detail: this.translate('shared.fill.required.fields'),\n });\n return;\n }\n\n this.isLoading.set(true);\n\n const userModel = this.userFormModel();\n const companyModel = this.companyFormModel();\n\n let registrationData: Record<string, unknown> = {\n name: userModel.name,\n email: userModel.email,\n password: userModel.password,\n phone: userModel.phone || undefined,\n };\n\n const extraFieldsData = this.extraFieldsModel();\n if (Object.keys(extraFieldsData).length > 0) {\n registrationData['additionalFields'] = extraFieldsData;\n }\n\n if (this.registrationExtension?.transformRegistrationData) {\n registrationData =\n this.registrationExtension.transformRegistrationData(registrationData);\n }\n\n if (isCompanyFeatureEnabled(this.appConfig)) {\n if (companyModel.createNewCompany) {\n registrationData['newCompanyName'] =\n companyModel.newCompanyName || undefined;\n registrationData['newCompanyPhone'] =\n companyModel.newCompanyPhone || undefined;\n registrationData['newCompanyAddress'] =\n companyModel.newCompanyAddress || undefined;\n } else {\n registrationData['companySlug'] = companyModel.companySlug || undefined;\n registrationData['branchSlug'] = companyModel.branchSlug || undefined;\n }\n }\n\n this.authApi\n .register(registrationData as unknown as IRegistrationRequest)\n .pipe(takeUntilDestroyed(this.destroyRef))\n .subscribe({\n next: (response) => {\n this.isLoading.set(false);\n const data = response.data;\n if (!data) return;\n\n if (data.requiresEmailVerification) {\n this.messageService.add({\n severity: 'success',\n summary: this.translate('shared.success'),\n detail: response.messageKey\n ? this.translate(response.messageKey, response.messageVariables)\n : response.message,\n life: 5000,\n });\n this.router.navigate(['/auth/login']);\n return;\n }\n\n if (data.accessToken) {\n this.authState.setLoginState({\n accessToken: data.accessToken,\n user: data.user,\n company: data.company,\n branch: data.branch,\n });\n this.messageService.add({\n severity: 'success',\n summary: this.translate('shared.success'),\n detail: response.messageKey\n ? this.translate(response.messageKey, response.messageVariables)\n : response.message,\n });\n this.authState.navigateAfterLogin(this.returnUrl());\n }\n },\n error: () => {\n this.isLoading.set(false);\n },\n });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;AA6iBA,IAAa,wBAAb,MAAa,sBAAqB;CACf,aAAa,OAAO,UAAU;CAC9B,YAAY,OAAO,UAAU;CAC7B,iBAAiB,OAAO,cAAc;CACtC,UAAU,OAAO,cAAc;CAC/B,YAAY,OA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
2
|
+
import * as i0 from "@angular/core";
|
|
3
|
+
import { Component, DestroyRef, computed, effect, inject, signal } from "@angular/core";
|
|
4
|
+
import { finalize } from "rxjs";
|
|
5
|
+
import { ActivatedRoute, RouterLink } from "@angular/router";
|
|
6
|
+
import { TranslatePipe, TranslateService } from "@flusys/ng-shared";
|
|
7
|
+
import { FButtonDirective, MessageService, PasswordComponent, UiIconComponent } from "@flusys/ng-ui";
|
|
8
|
+
import { AppFloatingConfigurator } from "@flusys/ng-layout";
|
|
9
|
+
import { takeUntilDestroyed, toSignal } from "@angular/core/rxjs-interop";
|
|
10
|
+
import { FormField, form, required } from "@angular/forms/signals";
|
|
11
|
+
var ResetPasswordPageComponent = class ResetPasswordPageComponent {
|
|
12
|
+
destroyRef = inject(DestroyRef);
|
|
13
|
+
route = inject(ActivatedRoute);
|
|
14
|
+
messageService = inject(MessageService);
|
|
15
|
+
authApi = inject(AuthApiService);
|
|
16
|
+
passwordPolicy = inject(PasswordPolicyService);
|
|
17
|
+
translateAdapter = inject(TranslateService, { optional: true });
|
|
18
|
+
translate(key, vars) {
|
|
19
|
+
return this.translateAdapter?.translate(key, vars) ?? key;
|
|
20
|
+
}
|
|
21
|
+
queryParams = toSignal(this.route.queryParams);
|
|
22
|
+
tokenInitialized = false;
|
|
23
|
+
token = "";
|
|
24
|
+
isLoading = signal(false, ...ngDevMode ? [{ debugName: "isLoading" }] : /* istanbul ignore next */ []);
|
|
25
|
+
pageState = signal("form", ...ngDevMode ? [{ debugName: "pageState" }] : /* istanbul ignore next */ []);
|
|
26
|
+
formModel = signal({
|
|
27
|
+
newPassword: "",
|
|
28
|
+
confirmPassword: ""
|
|
29
|
+
}, ...ngDevMode ? [{ debugName: "formModel" }] : /* istanbul ignore next */ []);
|
|
30
|
+
resetForm = form(this.formModel, (f) => {
|
|
31
|
+
required(f.newPassword, { message: this.translate("auth.validation.password.required") });
|
|
32
|
+
required(f.confirmPassword, { message: this.translate("auth.validation.confirm.password.required") });
|
|
33
|
+
});
|
|
34
|
+
passwordMismatch = computed(() => {
|
|
35
|
+
const model = this.formModel();
|
|
36
|
+
return model.confirmPassword.length > 0 && model.newPassword !== model.confirmPassword;
|
|
37
|
+
}, ...ngDevMode ? [{ debugName: "passwordMismatch" }] : /* istanbul ignore next */ []);
|
|
38
|
+
passwordValidationError = computed(() => this.passwordPolicy.validate(this.formModel().newPassword), ...ngDevMode ? [{ debugName: "passwordValidationError" }] : /* istanbul ignore next */ []);
|
|
39
|
+
canSubmit = computed(() => this.resetForm().valid() && !this.passwordValidationError() && !this.passwordMismatch(), ...ngDevMode ? [{ debugName: "canSubmit" }] : /* istanbul ignore next */ []);
|
|
40
|
+
constructor() {
|
|
41
|
+
effect(() => {
|
|
42
|
+
const params = this.queryParams();
|
|
43
|
+
if (!params || this.tokenInitialized) return;
|
|
44
|
+
this.tokenInitialized = true;
|
|
45
|
+
this.token = params["token"] || "";
|
|
46
|
+
if (!this.token) this.pageState.set("invalid-token");
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
onSubmit(event) {
|
|
50
|
+
event.preventDefault();
|
|
51
|
+
if (!this.canSubmit()) {
|
|
52
|
+
this.messageService.add({
|
|
53
|
+
severity: "error",
|
|
54
|
+
summary: this.translate("shared.validation.error"),
|
|
55
|
+
detail: this.translate("shared.fill.required.fields")
|
|
56
|
+
});
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
this.isLoading.set(true);
|
|
60
|
+
const newPassword = this.formModel().newPassword;
|
|
61
|
+
this.authApi.resetPassword(this.token, newPassword).pipe(takeUntilDestroyed(this.destroyRef), finalize(() => this.isLoading.set(false))).subscribe({
|
|
62
|
+
next: (response) => {
|
|
63
|
+
this.messageService.add({
|
|
64
|
+
severity: "success",
|
|
65
|
+
summary: this.translate("shared.success"),
|
|
66
|
+
detail: response?.messageKey ? this.translate(response.messageKey, response.messageVariables) : response?.message
|
|
67
|
+
});
|
|
68
|
+
this.pageState.set("success");
|
|
69
|
+
},
|
|
70
|
+
error: (error) => {
|
|
71
|
+
const messageKey = error.error?.messageKey || "";
|
|
72
|
+
if ([
|
|
73
|
+
"auth.password.reset.token.expired",
|
|
74
|
+
"auth.password.reset.token.used",
|
|
75
|
+
"email.verification.token.invalid"
|
|
76
|
+
].includes(messageKey)) this.pageState.set("invalid-token");
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
static ɵfac = i0.ɵɵngDeclareFactory({
|
|
81
|
+
minVersion: "12.0.0",
|
|
82
|
+
version: "22.2.1",
|
|
83
|
+
ngImport: i0,
|
|
84
|
+
type: ResetPasswordPageComponent,
|
|
85
|
+
deps: [],
|
|
86
|
+
target: i0.ɵɵFactoryTarget.Component
|
|
87
|
+
});
|
|
88
|
+
static ɵcmp = i0.ɵɵngDeclareComponent({
|
|
89
|
+
minVersion: "17.0.0",
|
|
90
|
+
version: "22.2.1",
|
|
91
|
+
type: ResetPasswordPageComponent,
|
|
92
|
+
isStandalone: true,
|
|
93
|
+
selector: "lib-reset-password-page",
|
|
94
|
+
ngImport: i0,
|
|
95
|
+
template: `
|
|
96
|
+
<app-floating-configurator />
|
|
97
|
+
<div
|
|
98
|
+
class="bg-surface-ground flex items-center justify-center min-h-screen"
|
|
99
|
+
>
|
|
100
|
+
<div
|
|
101
|
+
class="flex flex-col items-center justify-center w-full max-w-[32rem] px-4"
|
|
102
|
+
>
|
|
103
|
+
<div
|
|
104
|
+
class="w-full"
|
|
105
|
+
style="border-radius: var(--f-content-border-radius); padding: 0.3rem; background: linear-gradient(180deg, var(--primary-color) 10%, rgba(33, 150, 243, 0) 30%)"
|
|
106
|
+
>
|
|
107
|
+
<div
|
|
108
|
+
class="w-full py-8 px-4 sm:py-12 sm:px-8 md:py-16 md:px-12"
|
|
109
|
+
style="border-radius: var(--f-content-border-radius); background: var(--f-content-background)"
|
|
110
|
+
>
|
|
111
|
+
@switch (pageState()) {
|
|
112
|
+
@case ('form') {
|
|
113
|
+
<div class="text-center mb-8">
|
|
114
|
+
<div class="text-3xl font-medium mb-4 text-color">
|
|
115
|
+
{{ 'auth.reset.password.title' | translate }}
|
|
116
|
+
</div>
|
|
117
|
+
<span class="text-muted-color font-medium">
|
|
118
|
+
{{ 'auth.reset.password.subtitle' | translate }}
|
|
119
|
+
</span>
|
|
120
|
+
</div>
|
|
121
|
+
|
|
122
|
+
<form (submit)="onSubmit($event)">
|
|
123
|
+
<label
|
|
124
|
+
for="newPassword"
|
|
125
|
+
class="block text-lg font-medium mb-2 text-color"
|
|
126
|
+
>
|
|
127
|
+
{{ 'auth.reset.password.new.password' | translate }}
|
|
128
|
+
</label>
|
|
129
|
+
<div class="mb-4">
|
|
130
|
+
<f-password
|
|
131
|
+
[inputId]="'newPassword'"
|
|
132
|
+
[placeholder]="
|
|
133
|
+
'auth.reset.password.new.password.placeholder' | translate
|
|
134
|
+
"
|
|
135
|
+
class="w-full"
|
|
136
|
+
[formField]="resetForm.newPassword"
|
|
137
|
+
autocomplete="new-password"
|
|
138
|
+
/>
|
|
139
|
+
@if (passwordValidationError()) {
|
|
140
|
+
<small class="text-danger block mt-1">{{
|
|
141
|
+
passwordValidationError()
|
|
142
|
+
}}</small>
|
|
143
|
+
}
|
|
144
|
+
</div>
|
|
145
|
+
|
|
146
|
+
<label
|
|
147
|
+
for="confirmPassword"
|
|
148
|
+
class="block text-lg font-medium mb-2 text-color"
|
|
149
|
+
>
|
|
150
|
+
{{ 'auth.reset.password.confirm.password' | translate }}
|
|
151
|
+
</label>
|
|
152
|
+
<f-password
|
|
153
|
+
[inputId]="'confirmPassword'"
|
|
154
|
+
[placeholder]="
|
|
155
|
+
'auth.reset.password.confirm.password.placeholder'
|
|
156
|
+
| translate
|
|
157
|
+
"
|
|
158
|
+
class="w-full mb-2"
|
|
159
|
+
[formField]="resetForm.confirmPassword"
|
|
160
|
+
autocomplete="new-password"
|
|
161
|
+
/>
|
|
162
|
+
|
|
163
|
+
@if (passwordMismatch()) {
|
|
164
|
+
<small class="text-danger block mb-4">{{
|
|
165
|
+
'auth.register.passwords.do.not.match' | translate
|
|
166
|
+
}}</small>
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
<button
|
|
170
|
+
fButton
|
|
171
|
+
class="w-full mt-4 mb-4"
|
|
172
|
+
type="submit"
|
|
173
|
+
[disabled]="!canSubmit() || isLoading()"
|
|
174
|
+
>
|
|
175
|
+
@if (isLoading()) {
|
|
176
|
+
<ui-icon pButtonIcon name="spinner" [spin]="true"></ui-icon>
|
|
177
|
+
}
|
|
178
|
+
<span pButtonLabel>{{ 'auth.reset.password.reset.password' | translate }}</span>
|
|
179
|
+
</button>
|
|
180
|
+
|
|
181
|
+
<div class="flex items-center justify-center gap-2">
|
|
182
|
+
<a
|
|
183
|
+
routerLink="/auth/login"
|
|
184
|
+
class="font-semibold text-primary cursor-pointer"
|
|
185
|
+
>
|
|
186
|
+
{{ 'auth.login.back.to.sign.in' | translate }}
|
|
187
|
+
</a>
|
|
188
|
+
</div>
|
|
189
|
+
</form>
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
@case ('success') {
|
|
193
|
+
<div class="text-center">
|
|
194
|
+
<div class="flex justify-center mb-6">
|
|
195
|
+
<ui-icon name="check-circle" class="text-6xl text-success"></ui-icon>
|
|
196
|
+
</div>
|
|
197
|
+
<div class="text-3xl font-medium mb-4 text-color">
|
|
198
|
+
{{ 'auth.reset.password.success' | translate }}
|
|
199
|
+
</div>
|
|
200
|
+
<p class="text-muted-color font-medium mb-6">
|
|
201
|
+
{{ 'auth.reset.password.success.message' | translate }}
|
|
202
|
+
</p>
|
|
203
|
+
<a routerLink="/auth/login">
|
|
204
|
+
<button
|
|
205
|
+
fButton
|
|
206
|
+
class="w-full"
|
|
207
|
+
>
|
|
208
|
+
<span pButtonLabel>{{ 'auth.login.sign.in' | translate }}</span>
|
|
209
|
+
</button>
|
|
210
|
+
</a>
|
|
211
|
+
</div>
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
@case ('invalid-token') {
|
|
215
|
+
<div class="text-center">
|
|
216
|
+
<div class="flex justify-center mb-6">
|
|
217
|
+
<ui-icon name="times-circle" class="text-6xl text-danger"></ui-icon>
|
|
218
|
+
</div>
|
|
219
|
+
<div class="text-3xl font-medium mb-4 text-color">
|
|
220
|
+
{{ 'auth.reset.password.invalid.link' | translate }}
|
|
221
|
+
</div>
|
|
222
|
+
<p class="text-muted-color font-medium mb-6">
|
|
223
|
+
{{ 'auth.reset.password.invalid.link.message' | translate }}
|
|
224
|
+
</p>
|
|
225
|
+
<a routerLink="/auth/forgot-password">
|
|
226
|
+
<button
|
|
227
|
+
fButton
|
|
228
|
+
class="w-full mb-4"
|
|
229
|
+
>
|
|
230
|
+
<span pButtonLabel>{{
|
|
231
|
+
'auth.reset.password.request.new.link' | translate
|
|
232
|
+
}}</span>
|
|
233
|
+
</button>
|
|
234
|
+
</a>
|
|
235
|
+
<div class="mt-4">
|
|
236
|
+
<a
|
|
237
|
+
routerLink="/auth/login"
|
|
238
|
+
class="font-semibold text-primary cursor-pointer"
|
|
239
|
+
>
|
|
240
|
+
{{ 'auth.login.back.to.sign.in' | translate }}
|
|
241
|
+
</a>
|
|
242
|
+
</div>
|
|
243
|
+
</div>
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
</div>
|
|
247
|
+
</div>
|
|
248
|
+
</div>
|
|
249
|
+
</div>
|
|
250
|
+
`,
|
|
251
|
+
isInline: true,
|
|
252
|
+
dependencies: [
|
|
253
|
+
{
|
|
254
|
+
kind: "directive",
|
|
255
|
+
type: RouterLink,
|
|
256
|
+
selector: "[routerLink]",
|
|
257
|
+
inputs: [
|
|
258
|
+
"target",
|
|
259
|
+
"queryParams",
|
|
260
|
+
"fragment",
|
|
261
|
+
"queryParamsHandling",
|
|
262
|
+
"state",
|
|
263
|
+
"info",
|
|
264
|
+
"relativeTo",
|
|
265
|
+
"preserveFragment",
|
|
266
|
+
"skipLocationChange",
|
|
267
|
+
"replaceUrl",
|
|
268
|
+
"browserUrl",
|
|
269
|
+
"routerLink"
|
|
270
|
+
]
|
|
271
|
+
},
|
|
272
|
+
{
|
|
273
|
+
kind: "directive",
|
|
274
|
+
type: FButtonDirective,
|
|
275
|
+
selector: "[fButton]",
|
|
276
|
+
inputs: [
|
|
277
|
+
"severity",
|
|
278
|
+
"text",
|
|
279
|
+
"outlined",
|
|
280
|
+
"link",
|
|
281
|
+
"variant",
|
|
282
|
+
"rounded",
|
|
283
|
+
"raised",
|
|
284
|
+
"fluid",
|
|
285
|
+
"disabled",
|
|
286
|
+
"loading",
|
|
287
|
+
"loadingIcon",
|
|
288
|
+
"size",
|
|
289
|
+
"label",
|
|
290
|
+
"icon",
|
|
291
|
+
"iconPos",
|
|
292
|
+
"ariaLabel",
|
|
293
|
+
"plain"
|
|
294
|
+
]
|
|
295
|
+
},
|
|
296
|
+
{
|
|
297
|
+
kind: "component",
|
|
298
|
+
type: PasswordComponent,
|
|
299
|
+
selector: "f-password",
|
|
300
|
+
inputs: [
|
|
301
|
+
"toggleMask",
|
|
302
|
+
"feedback",
|
|
303
|
+
"disabled",
|
|
304
|
+
"placeholder",
|
|
305
|
+
"inputId",
|
|
306
|
+
"invalid",
|
|
307
|
+
"touched",
|
|
308
|
+
"inputStyleClass",
|
|
309
|
+
"styleClass",
|
|
310
|
+
"style",
|
|
311
|
+
"ariaDescribedby",
|
|
312
|
+
"autocomplete",
|
|
313
|
+
"variant",
|
|
314
|
+
"size",
|
|
315
|
+
"fluid",
|
|
316
|
+
"appendTo",
|
|
317
|
+
"promptLabel",
|
|
318
|
+
"weakLabel",
|
|
319
|
+
"mediumLabel",
|
|
320
|
+
"strongLabel",
|
|
321
|
+
"mediumRegex",
|
|
322
|
+
"strongRegex"
|
|
323
|
+
],
|
|
324
|
+
outputs: ["onBlur", "onFocus"]
|
|
325
|
+
},
|
|
326
|
+
{
|
|
327
|
+
kind: "component",
|
|
328
|
+
type: UiIconComponent,
|
|
329
|
+
selector: "ui-icon",
|
|
330
|
+
inputs: [
|
|
331
|
+
"name",
|
|
332
|
+
"size",
|
|
333
|
+
"spin",
|
|
334
|
+
"fill",
|
|
335
|
+
"severity"
|
|
336
|
+
]
|
|
337
|
+
},
|
|
338
|
+
{
|
|
339
|
+
kind: "directive",
|
|
340
|
+
type: FormField,
|
|
341
|
+
selector: "[formField]",
|
|
342
|
+
inputs: ["formField"],
|
|
343
|
+
exportAs: ["formField"]
|
|
344
|
+
},
|
|
345
|
+
{
|
|
346
|
+
kind: "component",
|
|
347
|
+
type: AppFloatingConfigurator,
|
|
348
|
+
selector: "app-floating-configurator"
|
|
349
|
+
},
|
|
350
|
+
{
|
|
351
|
+
kind: "pipe",
|
|
352
|
+
type: TranslatePipe,
|
|
353
|
+
name: "translate"
|
|
354
|
+
}
|
|
355
|
+
]
|
|
356
|
+
});
|
|
357
|
+
};
|
|
358
|
+
i0.ɵɵngDeclareClassMetadata({
|
|
359
|
+
minVersion: "12.0.0",
|
|
360
|
+
version: "22.2.1",
|
|
361
|
+
ngImport: i0,
|
|
362
|
+
type: ResetPasswordPageComponent,
|
|
363
|
+
decorators: [{
|
|
364
|
+
type: Component,
|
|
365
|
+
args: [{
|
|
366
|
+
selector: "lib-reset-password-page",
|
|
367
|
+
imports: [
|
|
368
|
+
RouterLink,
|
|
369
|
+
FButtonDirective,
|
|
370
|
+
PasswordComponent,
|
|
371
|
+
UiIconComponent,
|
|
372
|
+
FormField,
|
|
373
|
+
AppFloatingConfigurator,
|
|
374
|
+
TranslatePipe
|
|
375
|
+
],
|
|
376
|
+
template: `
|
|
377
|
+
<app-floating-configurator />
|
|
378
|
+
<div
|
|
379
|
+
class="bg-surface-ground flex items-center justify-center min-h-screen"
|
|
380
|
+
>
|
|
381
|
+
<div
|
|
382
|
+
class="flex flex-col items-center justify-center w-full max-w-[32rem] px-4"
|
|
383
|
+
>
|
|
384
|
+
<div
|
|
385
|
+
class="w-full"
|
|
386
|
+
style="border-radius: var(--f-content-border-radius); padding: 0.3rem; background: linear-gradient(180deg, var(--primary-color) 10%, rgba(33, 150, 243, 0) 30%)"
|
|
387
|
+
>
|
|
388
|
+
<div
|
|
389
|
+
class="w-full py-8 px-4 sm:py-12 sm:px-8 md:py-16 md:px-12"
|
|
390
|
+
style="border-radius: var(--f-content-border-radius); background: var(--f-content-background)"
|
|
391
|
+
>
|
|
392
|
+
@switch (pageState()) {
|
|
393
|
+
@case ('form') {
|
|
394
|
+
<div class="text-center mb-8">
|
|
395
|
+
<div class="text-3xl font-medium mb-4 text-color">
|
|
396
|
+
{{ 'auth.reset.password.title' | translate }}
|
|
397
|
+
</div>
|
|
398
|
+
<span class="text-muted-color font-medium">
|
|
399
|
+
{{ 'auth.reset.password.subtitle' | translate }}
|
|
400
|
+
</span>
|
|
401
|
+
</div>
|
|
402
|
+
|
|
403
|
+
<form (submit)="onSubmit($event)">
|
|
404
|
+
<label
|
|
405
|
+
for="newPassword"
|
|
406
|
+
class="block text-lg font-medium mb-2 text-color"
|
|
407
|
+
>
|
|
408
|
+
{{ 'auth.reset.password.new.password' | translate }}
|
|
409
|
+
</label>
|
|
410
|
+
<div class="mb-4">
|
|
411
|
+
<f-password
|
|
412
|
+
[inputId]="'newPassword'"
|
|
413
|
+
[placeholder]="
|
|
414
|
+
'auth.reset.password.new.password.placeholder' | translate
|
|
415
|
+
"
|
|
416
|
+
class="w-full"
|
|
417
|
+
[formField]="resetForm.newPassword"
|
|
418
|
+
autocomplete="new-password"
|
|
419
|
+
/>
|
|
420
|
+
@if (passwordValidationError()) {
|
|
421
|
+
<small class="text-danger block mt-1">{{
|
|
422
|
+
passwordValidationError()
|
|
423
|
+
}}</small>
|
|
424
|
+
}
|
|
425
|
+
</div>
|
|
426
|
+
|
|
427
|
+
<label
|
|
428
|
+
for="confirmPassword"
|
|
429
|
+
class="block text-lg font-medium mb-2 text-color"
|
|
430
|
+
>
|
|
431
|
+
{{ 'auth.reset.password.confirm.password' | translate }}
|
|
432
|
+
</label>
|
|
433
|
+
<f-password
|
|
434
|
+
[inputId]="'confirmPassword'"
|
|
435
|
+
[placeholder]="
|
|
436
|
+
'auth.reset.password.confirm.password.placeholder'
|
|
437
|
+
| translate
|
|
438
|
+
"
|
|
439
|
+
class="w-full mb-2"
|
|
440
|
+
[formField]="resetForm.confirmPassword"
|
|
441
|
+
autocomplete="new-password"
|
|
442
|
+
/>
|
|
443
|
+
|
|
444
|
+
@if (passwordMismatch()) {
|
|
445
|
+
<small class="text-danger block mb-4">{{
|
|
446
|
+
'auth.register.passwords.do.not.match' | translate
|
|
447
|
+
}}</small>
|
|
448
|
+
}
|
|
449
|
+
|
|
450
|
+
<button
|
|
451
|
+
fButton
|
|
452
|
+
class="w-full mt-4 mb-4"
|
|
453
|
+
type="submit"
|
|
454
|
+
[disabled]="!canSubmit() || isLoading()"
|
|
455
|
+
>
|
|
456
|
+
@if (isLoading()) {
|
|
457
|
+
<ui-icon pButtonIcon name="spinner" [spin]="true"></ui-icon>
|
|
458
|
+
}
|
|
459
|
+
<span pButtonLabel>{{ 'auth.reset.password.reset.password' | translate }}</span>
|
|
460
|
+
</button>
|
|
461
|
+
|
|
462
|
+
<div class="flex items-center justify-center gap-2">
|
|
463
|
+
<a
|
|
464
|
+
routerLink="/auth/login"
|
|
465
|
+
class="font-semibold text-primary cursor-pointer"
|
|
466
|
+
>
|
|
467
|
+
{{ 'auth.login.back.to.sign.in' | translate }}
|
|
468
|
+
</a>
|
|
469
|
+
</div>
|
|
470
|
+
</form>
|
|
471
|
+
}
|
|
472
|
+
|
|
473
|
+
@case ('success') {
|
|
474
|
+
<div class="text-center">
|
|
475
|
+
<div class="flex justify-center mb-6">
|
|
476
|
+
<ui-icon name="check-circle" class="text-6xl text-success"></ui-icon>
|
|
477
|
+
</div>
|
|
478
|
+
<div class="text-3xl font-medium mb-4 text-color">
|
|
479
|
+
{{ 'auth.reset.password.success' | translate }}
|
|
480
|
+
</div>
|
|
481
|
+
<p class="text-muted-color font-medium mb-6">
|
|
482
|
+
{{ 'auth.reset.password.success.message' | translate }}
|
|
483
|
+
</p>
|
|
484
|
+
<a routerLink="/auth/login">
|
|
485
|
+
<button
|
|
486
|
+
fButton
|
|
487
|
+
class="w-full"
|
|
488
|
+
>
|
|
489
|
+
<span pButtonLabel>{{ 'auth.login.sign.in' | translate }}</span>
|
|
490
|
+
</button>
|
|
491
|
+
</a>
|
|
492
|
+
</div>
|
|
493
|
+
}
|
|
494
|
+
|
|
495
|
+
@case ('invalid-token') {
|
|
496
|
+
<div class="text-center">
|
|
497
|
+
<div class="flex justify-center mb-6">
|
|
498
|
+
<ui-icon name="times-circle" class="text-6xl text-danger"></ui-icon>
|
|
499
|
+
</div>
|
|
500
|
+
<div class="text-3xl font-medium mb-4 text-color">
|
|
501
|
+
{{ 'auth.reset.password.invalid.link' | translate }}
|
|
502
|
+
</div>
|
|
503
|
+
<p class="text-muted-color font-medium mb-6">
|
|
504
|
+
{{ 'auth.reset.password.invalid.link.message' | translate }}
|
|
505
|
+
</p>
|
|
506
|
+
<a routerLink="/auth/forgot-password">
|
|
507
|
+
<button
|
|
508
|
+
fButton
|
|
509
|
+
class="w-full mb-4"
|
|
510
|
+
>
|
|
511
|
+
<span pButtonLabel>{{
|
|
512
|
+
'auth.reset.password.request.new.link' | translate
|
|
513
|
+
}}</span>
|
|
514
|
+
</button>
|
|
515
|
+
</a>
|
|
516
|
+
<div class="mt-4">
|
|
517
|
+
<a
|
|
518
|
+
routerLink="/auth/login"
|
|
519
|
+
class="font-semibold text-primary cursor-pointer"
|
|
520
|
+
>
|
|
521
|
+
{{ 'auth.login.back.to.sign.in' | translate }}
|
|
522
|
+
</a>
|
|
523
|
+
</div>
|
|
524
|
+
</div>
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
</div>
|
|
528
|
+
</div>
|
|
529
|
+
</div>
|
|
530
|
+
</div>
|
|
531
|
+
`
|
|
532
|
+
}]
|
|
533
|
+
}],
|
|
534
|
+
ctorParameters: () => []
|
|
535
|
+
});
|
|
536
|
+
export { ResetPasswordPageComponent };
|
|
537
|
+
|
|
538
|
+
//# sourceMappingURL=flusys-ng-auth-reset-password-page.component-C0tN_AW1.mjs.map
|