@rtsee/ngx 0.0.59 → 0.0.61
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/dist/ngx/fesm2022/rtsee-ngx.mjs +1689 -0
- package/dist/ngx/fesm2022/rtsee-ngx.mjs.map +1 -0
- package/dist/ngx/index.d.ts +538 -0
- package/package.json +21 -18
- package/.editorconfig +0 -16
- package/CHANGELOG.md +0 -120
- package/angular.json +0 -67
- package/jest.config.ts +0 -9
- package/projects/ngx/ng-package.json +0 -8
- package/projects/ngx/package.json +0 -20
- package/projects/ngx/src/lib/common/components/preloader/preloader.component.html +0 -5
- package/projects/ngx/src/lib/common/components/preloader/preloader.component.ts +0 -30
- package/projects/ngx/src/lib/common/interfaces/index.ts +0 -1
- package/projects/ngx/src/lib/common/interfaces/server-errors.ts +0 -5
- package/projects/ngx/src/lib/components/constans/common.const.ts +0 -8
- package/projects/ngx/src/lib/components/enums/form.enum.ts +0 -8
- package/projects/ngx/src/lib/components/rtsee/rtsee-conference.component.html +0 -70
- package/projects/ngx/src/lib/components/rtsee/rtsee-conference.component.ts +0 -35
- package/projects/ngx/src/lib/components/rtsee/rtsee-controls/rtsee-controls.component.html +0 -54
- package/projects/ngx/src/lib/components/rtsee/rtsee-controls/rtsee-controls.component.scss +0 -70
- package/projects/ngx/src/lib/components/rtsee/rtsee-controls/rtsee-controls.component.ts +0 -24
- package/projects/ngx/src/lib/components/rtsee-auth/auth/auth.component.html +0 -16
- package/projects/ngx/src/lib/components/rtsee-auth/auth/auth.component.ts +0 -48
- package/projects/ngx/src/lib/components/rtsee-auth/forgot-password/forgot-password.component.html +0 -35
- package/projects/ngx/src/lib/components/rtsee-auth/forgot-password/forgot-password.component.ts +0 -42
- package/projects/ngx/src/lib/components/rtsee-auth/reset-password/reset-password.component.html +0 -43
- package/projects/ngx/src/lib/components/rtsee-auth/reset-password/reset-password.component.ts +0 -83
- package/projects/ngx/src/lib/components/rtsee-auth/services/auth.service.ts +0 -40
- package/projects/ngx/src/lib/components/rtsee-auth/services/utils.service.ts +0 -20
- package/projects/ngx/src/lib/components/rtsee-auth/sign-in/sign-in.component.html +0 -84
- package/projects/ngx/src/lib/components/rtsee-auth/sign-in/sign-in.component.ts +0 -120
- package/projects/ngx/src/lib/components/rtsee-auth/sign-up/sign-up.component.html +0 -51
- package/projects/ngx/src/lib/components/rtsee-auth/sign-up/sign-up.component.ts +0 -67
- package/projects/ngx/src/lib/components/rtsee-auth/types/auth-form.type.ts +0 -36
- package/projects/ngx/src/lib/components/rtsee-auth/validators/form-fields-validators.ts +0 -27
- package/projects/ngx/src/lib/components/rtsee-auth/vendors/vendors.component.html +0 -1
- package/projects/ngx/src/lib/components/rtsee-auth/vendors/vendors.component.ts +0 -10
- package/projects/ngx/src/lib/components/rtsee-container/rtsee-container.component.html +0 -46
- package/projects/ngx/src/lib/components/rtsee-container/rtsee-container.component.ts +0 -34
- package/projects/ngx/src/lib/components/rtsee-container/rtsee-nav/rtsee-nav.component.html +0 -25
- package/projects/ngx/src/lib/components/rtsee-container/rtsee-nav/rtsee-nav.component.ts +0 -26
- package/projects/ngx/src/lib/components/rtsee-events-dashboard/components/event-thumbnail/event-thumbnail.component.html +0 -20
- package/projects/ngx/src/lib/components/rtsee-events-dashboard/components/event-thumbnail/event-thumbnail.component.ts +0 -89
- package/projects/ngx/src/lib/components/rtsee-events-dashboard/components/rtsee-events-dashboard-client/rtsee-events-dashboard-client.component.html +0 -1
- package/projects/ngx/src/lib/components/rtsee-events-dashboard/components/rtsee-events-dashboard-client/rtsee-events-dashboard-client.component.ts +0 -8
- package/projects/ngx/src/lib/components/rtsee-events-dashboard/components/rtsee-events-dashboard-client-thumbnail/rtsee-events-dashboard-client-thumbnail.component.html +0 -25
- package/projects/ngx/src/lib/components/rtsee-events-dashboard/components/rtsee-events-dashboard-client-thumbnail/rtsee-events-dashboard-client-thumbnail.component.ts +0 -40
- package/projects/ngx/src/lib/components/rtsee-events-dashboard/components/rtsee-events-dashboard-session/rtsee-events-dashboard-session.component.html +0 -32
- package/projects/ngx/src/lib/components/rtsee-events-dashboard/components/rtsee-events-dashboard-session/rtsee-events-dashboard-session.component.ts +0 -21
- package/projects/ngx/src/lib/components/rtsee-events-dashboard/rtsee-events-dashboard.component.html +0 -12
- package/projects/ngx/src/lib/components/rtsee-events-dashboard/rtsee-events-dashboard.component.ts +0 -19
- package/projects/ngx/src/lib/components/rtsee-messenger/chat/chat.component.html +0 -10
- package/projects/ngx/src/lib/components/rtsee-messenger/chat/chat.component.ts +0 -18
- package/projects/ngx/src/lib/components/rtsee-messenger/chat-input/chat-input.component.html +0 -20
- package/projects/ngx/src/lib/components/rtsee-messenger/chat-input/chat-input.component.ts +0 -31
- package/projects/ngx/src/lib/components/rtsee-messenger/chat-thumbnail/chat-thumbnail.component.html +0 -28
- package/projects/ngx/src/lib/components/rtsee-messenger/chat-thumbnail/chat-thumbnail.component.ts +0 -27
- package/projects/ngx/src/lib/components/rtsee-messenger/chats-list/chats-list.component.html +0 -6
- package/projects/ngx/src/lib/components/rtsee-messenger/chats-list/chats-list.component.ts +0 -22
- package/projects/ngx/src/lib/components/rtsee-messenger/main-menu/components/contacts-multiselect/contacts-multiselect.component.html +0 -3
- package/projects/ngx/src/lib/components/rtsee-messenger/main-menu/components/contacts-multiselect/contacts-multiselect.component.scss +0 -0
- package/projects/ngx/src/lib/components/rtsee-messenger/main-menu/components/contacts-multiselect/contacts-multiselect.component.ts +0 -18
- package/projects/ngx/src/lib/components/rtsee-messenger/main-menu/components/manage-chat/manage-chat.component.html +0 -4
- package/projects/ngx/src/lib/components/rtsee-messenger/main-menu/components/manage-chat/manage-chat.component.scss +0 -0
- package/projects/ngx/src/lib/components/rtsee-messenger/main-menu/components/manage-chat/manage-chat.component.ts +0 -18
- package/projects/ngx/src/lib/components/rtsee-messenger/main-menu/components/models/MainMenuState.ts +0 -11
- package/projects/ngx/src/lib/components/rtsee-messenger/main-menu/components/search/search.component.html +0 -25
- package/projects/ngx/src/lib/components/rtsee-messenger/main-menu/components/search/search.component.ts +0 -36
- package/projects/ngx/src/lib/components/rtsee-messenger/main-menu/main-menu.component.html +0 -32
- package/projects/ngx/src/lib/components/rtsee-messenger/main-menu/main-menu.component.ts +0 -41
- package/projects/ngx/src/lib/components/rtsee-messenger/message/components/message-time-and-status/message-time-and-status.component.html +0 -9
- package/projects/ngx/src/lib/components/rtsee-messenger/message/components/message-time-and-status/message-time-and-status.component.ts +0 -23
- package/projects/ngx/src/lib/components/rtsee-messenger/message/message.component.html +0 -17
- package/projects/ngx/src/lib/components/rtsee-messenger/message/message.component.ts +0 -64
- package/projects/ngx/src/lib/components/rtsee-messenger/message-widgets/call-widget/call-widget.component.html +0 -10
- package/projects/ngx/src/lib/components/rtsee-messenger/message-widgets/call-widget/call-widget.component.scss +0 -1
- package/projects/ngx/src/lib/components/rtsee-messenger/message-widgets/call-widget/call-widget.component.ts +0 -36
- package/projects/ngx/src/lib/components/rtsee-messenger/messages-list/messages-list.component.html +0 -18
- package/projects/ngx/src/lib/components/rtsee-messenger/messages-list/messages-list.component.ts +0 -91
- package/projects/ngx/src/lib/components/rtsee-messenger/messenger/messenger.component.html +0 -31
- package/projects/ngx/src/lib/components/rtsee-messenger/messenger/messenger.component.ts +0 -45
- package/projects/ngx/src/lib/components/rtsee-messenger/messenger-header/messenger-header.component.html +0 -57
- package/projects/ngx/src/lib/components/rtsee-messenger/messenger-header/messenger-header.component.ts +0 -30
- package/projects/ngx/src/lib/components/rtsee-messenger/profile/profile.component.html +0 -20
- package/projects/ngx/src/lib/components/rtsee-messenger/profile/profile.component.ts +0 -25
- package/projects/ngx/src/lib/components/rtsee-peer/rtsee-peer.component.html +0 -28
- package/projects/ngx/src/lib/components/rtsee-peer/rtsee-peer.component.ts +0 -43
- package/projects/ngx/src/lib/components/rtsee-peers-list/rtsee-peers-list.component.html +0 -1
- package/projects/ngx/src/lib/components/rtsee-peers-list/rtsee-peers-list.component.scss +0 -0
- package/projects/ngx/src/lib/components/rtsee-peers-list/rtsee-peers-list.component.ts +0 -9
- package/projects/ngx/src/lib/components/rtsee-presentation/presentation/presentation.component.html +0 -25
- package/projects/ngx/src/lib/components/rtsee-presentation/presentation/presentation.component.ts +0 -24
- package/projects/ngx/src/lib/components/rtsee-presentation/presentation-header/presentation-header.component.html +0 -14
- package/projects/ngx/src/lib/components/rtsee-presentation/presentation-header/presentation-header.component.ts +0 -15
- package/projects/ngx/src/lib/components/rtsee-presentation/slide/slide.component.html +0 -33
- package/projects/ngx/src/lib/components/rtsee-presentation/slide/slide.component.ts +0 -26
- package/projects/ngx/src/lib/components/rtsee-presentation/story-player/story-player.component.html +0 -10
- package/projects/ngx/src/lib/components/rtsee-presentation/story-player/story-player.component.ts +0 -22
- package/projects/ngx/src/lib/components/rtsee-presentation/story-thumbnail/story-thumbnail.component.html +0 -15
- package/projects/ngx/src/lib/components/rtsee-presentation/story-thumbnail/story-thumbnail.component.scss +0 -0
- package/projects/ngx/src/lib/components/rtsee-presentation/story-thumbnail/story-thumbnail.component.ts +0 -19
- package/projects/ngx/src/lib/components/rtsee-settings/rtsee-settings.component.html +0 -44
- package/projects/ngx/src/lib/components/rtsee-settings/rtsee-settings.component.scss +0 -30
- package/projects/ngx/src/lib/components/rtsee-settings/rtsee-settings.component.ts +0 -57
- package/projects/ngx/src/lib/components/rtsee-soundbar/rtsee-soundbar.component.html +0 -19
- package/projects/ngx/src/lib/components/rtsee-soundbar/rtsee-soundbar.component.scss +0 -56
- package/projects/ngx/src/lib/components/rtsee-soundbar/rtsee-soundbar.component.ts +0 -66
- package/projects/ngx/src/lib/directives/shave.directive.ts +0 -15
- package/projects/ngx/src/lib/directives/widget.directive.ts +0 -9
- package/projects/ngx/src/lib/ngx.module.ts +0 -127
- package/projects/ngx/src/lib/ngx.service.spec.ts +0 -16
- package/projects/ngx/src/lib/ngx.service.ts +0 -11
- package/projects/ngx/src/lib/services/default-images.service.ts +0 -8
- package/projects/ngx/src/lib/services/events-widgets.service.ts +0 -19
- package/projects/ngx/src/lib/services/message-widgets.service.ts +0 -26
- package/projects/ngx/src/lib/services/time-format-helper.service.ts +0 -111
- package/projects/ngx/src/public-api.ts +0 -16
- package/projects/ngx/tsconfig.lib.json +0 -14
- package/projects/ngx/tsconfig.lib.prod.json +0 -10
- package/projects/ngx/tsconfig.spec.json +0 -10
- package/projects/ngx/yarn.lock +0 -8
- package/scss-bundle.config.json +0 -6
- package/setup-jest.ts +0 -1
- package/tsconfig.eslint.json +0 -4
- package/tsconfig.json +0 -35
- package/tsconfig.spec.json +0 -8
- /package/{projects → dist}/ngx/README.md +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/auth/auth-container.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/auth/index.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/auth/variables.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/common-components/preloader.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/common-variables.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/common.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/containers/index.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/containers/nav-item.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/containers/nav.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/containers/shell.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/containers/variables.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/events-manager/client-thumbnail.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/events-manager/event-thumbnail.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/events-manager/events-dashboard-session.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/events-manager/events-dashboard.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/events-manager/events-manager.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/events-manager/index.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/events-manager.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/forms/common.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/forms/index.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/forms/variables.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/general.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/messenger/call-widget.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/messenger/chat-input.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/messenger/chat-thumbnail.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/messenger/chat.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/messenger/chats-list.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/messenger/index.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/messenger/message-time-and-status.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/messenger/message.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/messenger/messages-list.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/messenger/messenger-header.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/messenger/messenger-search.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/messenger/messenger.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/messenger/variables.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/presentation/index.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/presentation/slide.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/presentation/story-player.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/presentation/story-thumbnail.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/presentation/variables.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/styles.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/video-chat/index.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/video-chat/video-chat.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/video-chat/video-peer.scss +0 -0
- /package/{projects → dist}/ngx/src/lib/theme/video-chat.scss +0 -0
package/projects/ngx/src/lib/components/rtsee-auth/forgot-password/forgot-password.component.ts
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
1
|
-
import { Component } from '@angular/core';
|
|
2
|
-
import {FormBuilder, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';
|
|
3
|
-
import { UtilsService } from '../services/utils.service';
|
|
4
|
-
import { ForgotPasswordForm, TypedReactiveForm } from '../types/auth-form.type';
|
|
5
|
-
import {RouterLink} from "@angular/router";
|
|
6
|
-
import { RTSeeAuthConfiguration, AuthEndpointsKeys } from "@rtsee/auth";
|
|
7
|
-
import { RTSeeAuthService } from "../services/auth.service";
|
|
8
|
-
|
|
9
|
-
@Component({
|
|
10
|
-
selector: 'rtsee-forgot-password',
|
|
11
|
-
templateUrl: './forgot-password.component.html',
|
|
12
|
-
imports: [
|
|
13
|
-
ReactiveFormsModule,
|
|
14
|
-
RouterLink
|
|
15
|
-
],
|
|
16
|
-
standalone: true
|
|
17
|
-
})
|
|
18
|
-
export class ForgotPasswordComponent {
|
|
19
|
-
public isLoading: boolean = false;
|
|
20
|
-
public readonly emailForm: FormGroup<TypedReactiveForm<ForgotPasswordForm>>;
|
|
21
|
-
public readonly forgotPasswordFormKeys: Record<keyof ForgotPasswordForm, string>;
|
|
22
|
-
authConfiguration: RTSeeAuthConfiguration;
|
|
23
|
-
|
|
24
|
-
constructor(
|
|
25
|
-
private readonly formBuilder: FormBuilder,
|
|
26
|
-
private authService: RTSeeAuthService
|
|
27
|
-
) {
|
|
28
|
-
this.emailForm= this.formBuilder.group<TypedReactiveForm<ForgotPasswordForm>>({
|
|
29
|
-
email: this.formBuilder.nonNullable.control('', { validators: [Validators.required, Validators.email] }),
|
|
30
|
-
});
|
|
31
|
-
this.forgotPasswordFormKeys = UtilsService.getKeysAsValueObject(this.emailForm.getRawValue());
|
|
32
|
-
this.authConfiguration = this.authService.rtseeAuth.authConfiguration;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
public submitEmail(): void {
|
|
36
|
-
if (this.emailForm.valid) {
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
protected readonly AuthEndpointsKeys = AuthEndpointsKeys;
|
|
41
|
-
}
|
|
42
|
-
|
package/projects/ngx/src/lib/components/rtsee-auth/reset-password/reset-password.component.html
DELETED
|
@@ -1,43 +0,0 @@
|
|
|
1
|
-
<div class="auth-container">
|
|
2
|
-
<img src="assets/img.png" alt="Company Logo" class="logo" height="38" width="37" />
|
|
3
|
-
<h2 class="auth-title">Відновлення Пароля</h2>
|
|
4
|
-
<p class="auth-title-description">
|
|
5
|
-
Будь ласка, введіть новий пароль для вашого акаунту.
|
|
6
|
-
</p>
|
|
7
|
-
|
|
8
|
-
<form class="auth-form"
|
|
9
|
-
[formGroup]="resetPasswordForm"
|
|
10
|
-
(ngSubmit)="resetPassword()"
|
|
11
|
-
>
|
|
12
|
-
<!-- New Password Field -->
|
|
13
|
-
<label for="new-password"
|
|
14
|
-
class="auth-sm-medium"
|
|
15
|
-
>Новий пароль</label>
|
|
16
|
-
<input [formControlName]="passwordFormKeys.password"
|
|
17
|
-
type="password" id="new-password"
|
|
18
|
-
placeholder="Введіть новий пароль"
|
|
19
|
-
class="auth-input-container password-input"
|
|
20
|
-
/>
|
|
21
|
-
|
|
22
|
-
<!-- Confirm Password Field -->
|
|
23
|
-
<label for="confirm-password"
|
|
24
|
-
class="auth-sm-medium"
|
|
25
|
-
>Підтвердження пароля</label>
|
|
26
|
-
<input [formControlName]="passwordFormKeys.passwordConfirm"
|
|
27
|
-
type="password" id="confirm-password"
|
|
28
|
-
placeholder="Підтвердіть пароль"
|
|
29
|
-
class="auth-input-container password-input"
|
|
30
|
-
/>
|
|
31
|
-
|
|
32
|
-
<!-- Reset Password Button -->
|
|
33
|
-
<button type="submit"
|
|
34
|
-
class="auth-btn-container"
|
|
35
|
-
>Відновити Пароль</button>
|
|
36
|
-
</form>
|
|
37
|
-
|
|
38
|
-
<!-- Redirect to Login -->
|
|
39
|
-
<p class="auth-media-blue-gray-sm-normal">
|
|
40
|
-
<span>Згадали пароль?</span>
|
|
41
|
-
<a href="#" class="auth-deep-blue-sm-medium">Увійдіть</a>
|
|
42
|
-
</p>
|
|
43
|
-
</div>
|
package/projects/ngx/src/lib/components/rtsee-auth/reset-password/reset-password.component.ts
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { Component, OnInit } from '@angular/core';
|
|
2
|
-
import {FormBuilder, FormGroup, ReactiveFormsModule, ValidatorFn, Validators} from '@angular/forms';
|
|
3
|
-
import { ResetPasswordForm, TypedReactiveForm } from '../types/auth-form.type';
|
|
4
|
-
import { UtilsService } from '../services/utils.service';
|
|
5
|
-
import { ActivatedRoute } from '@angular/router';
|
|
6
|
-
import { FormErrorKey } from '../../enums/form.enum';
|
|
7
|
-
import { COMMON_CONSTANTS } from '../../constans/common.const';
|
|
8
|
-
import { RTSeeAuthService } from "../services/auth.service";
|
|
9
|
-
import { RTSeeAuthConfiguration } from "@rtsee/auth";
|
|
10
|
-
|
|
11
|
-
@Component({
|
|
12
|
-
selector: 'rtsee-reset-password',
|
|
13
|
-
templateUrl: './reset-password.component.html',
|
|
14
|
-
imports: [
|
|
15
|
-
ReactiveFormsModule
|
|
16
|
-
],
|
|
17
|
-
standalone: true
|
|
18
|
-
})
|
|
19
|
-
export class ResetPasswordComponent implements OnInit {
|
|
20
|
-
public isLoading: boolean = false;
|
|
21
|
-
public resetPasswordForm: FormGroup<TypedReactiveForm<ResetPasswordForm>>;
|
|
22
|
-
public passwordFormKeys: Record<keyof ResetPasswordForm, string>;
|
|
23
|
-
public hidePassword: Record<keyof ResetPasswordForm, boolean> = {
|
|
24
|
-
password: true,
|
|
25
|
-
passwordConfirm: true
|
|
26
|
-
};
|
|
27
|
-
private token!: string;
|
|
28
|
-
authConfiguration: RTSeeAuthConfiguration;
|
|
29
|
-
|
|
30
|
-
constructor(
|
|
31
|
-
private formBuilder: FormBuilder,
|
|
32
|
-
private route: ActivatedRoute,
|
|
33
|
-
private authService: RTSeeAuthService
|
|
34
|
-
) {
|
|
35
|
-
this.resetPasswordForm = this.formBuilder.group({
|
|
36
|
-
password: this.formBuilder.control('', {validators: [Validators.required, Validators.minLength(COMMON_CONSTANTS.minPasswordLength)], nonNullable: true}),
|
|
37
|
-
passwordConfirm: this.formBuilder.control('', {validators: [Validators.required, Validators.minLength(COMMON_CONSTANTS.minPasswordLength)], nonNullable: true}),
|
|
38
|
-
}, {validators: [this.passwordMatchValidator()]});
|
|
39
|
-
this.passwordFormKeys = UtilsService.getKeysAsValueObject(this.resetPasswordForm.value);
|
|
40
|
-
this.authConfiguration = this.authService.authConfiguration;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
public ngOnInit(): void {
|
|
44
|
-
this.token = this.route.snapshot.params['token'];
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
public resetPassword(): void {
|
|
48
|
-
if (this.resetPasswordForm.valid) {
|
|
49
|
-
// this.isLoading = true;
|
|
50
|
-
// this.accountService.resetPassword({passwords: this.resetPasswordForm.getRawValue(), token: this.token})
|
|
51
|
-
// .subscribe((success) => {
|
|
52
|
-
// this.isLoading = false;
|
|
53
|
-
// if (success) {
|
|
54
|
-
// this.router.navigate(['/', 'sign-in']);
|
|
55
|
-
// }
|
|
56
|
-
// })
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
private passwordMatchValidator(): ValidatorFn {
|
|
61
|
-
// @ts-ignore
|
|
62
|
-
return (form: FormGroup<TypedReactiveForm<ResetPasswordForm>>): ValidationErrors | null => {
|
|
63
|
-
const password = form.value.password;
|
|
64
|
-
const passwordConfirm = form.value.passwordConfirm;
|
|
65
|
-
if (password !== passwordConfirm) {
|
|
66
|
-
if (form.controls.password.valid) {
|
|
67
|
-
form.controls.password.setErrors({[FormErrorKey.passwordsMismatch]: true});
|
|
68
|
-
}
|
|
69
|
-
if (form.controls.passwordConfirm.valid) {
|
|
70
|
-
form.controls.passwordConfirm.setErrors({[FormErrorKey.passwordsMismatch]: true});
|
|
71
|
-
}
|
|
72
|
-
return {[FormErrorKey.passwordsMismatch]: true};
|
|
73
|
-
}
|
|
74
|
-
if (form.controls.password.hasError(FormErrorKey.passwordsMismatch)) {
|
|
75
|
-
form.controls.password.setErrors(null);
|
|
76
|
-
}
|
|
77
|
-
if (form.controls.passwordConfirm.hasError(FormErrorKey.passwordsMismatch)) {
|
|
78
|
-
form.controls.passwordConfirm.setErrors(null);
|
|
79
|
-
}
|
|
80
|
-
return null;
|
|
81
|
-
}
|
|
82
|
-
}
|
|
83
|
-
}
|
|
@@ -1,40 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
import {HttpClient} from "@angular/common/http";
|
|
3
|
-
import {
|
|
4
|
-
RTSeeAuth,
|
|
5
|
-
IRtseeSignInRequestOptions,
|
|
6
|
-
IRTSeeSignInResponse,
|
|
7
|
-
IRtseeSignUpRequestOptions,
|
|
8
|
-
IRTSeeSignUpResponse,
|
|
9
|
-
AuthEndpointsKeys,
|
|
10
|
-
RTSeeAuthConfiguration
|
|
11
|
-
} from "@rtsee/auth";
|
|
12
|
-
import { Observable, tap } from "rxjs";
|
|
13
|
-
|
|
14
|
-
@Injectable({
|
|
15
|
-
providedIn: 'root'
|
|
16
|
-
})
|
|
17
|
-
export class RTSeeAuthService {
|
|
18
|
-
rtseeAuth!: RTSeeAuth<any>;
|
|
19
|
-
authConfiguration!: RTSeeAuthConfiguration;
|
|
20
|
-
|
|
21
|
-
constructor(
|
|
22
|
-
private http: HttpClient,
|
|
23
|
-
) {}
|
|
24
|
-
|
|
25
|
-
init(auth: RTSeeAuth<any>) {
|
|
26
|
-
this.rtseeAuth = auth;
|
|
27
|
-
this.authConfiguration = this.rtseeAuth.authConfiguration;
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
signIn(credentials: IRtseeSignInRequestOptions): Observable<IRTSeeSignInResponse> {
|
|
31
|
-
return this.http
|
|
32
|
-
.post<IRTSeeSignInResponse>(this.authConfiguration.getEndpointPathByEndpointName(AuthEndpointsKeys.SIGN_IN), credentials)
|
|
33
|
-
.pipe(tap((res) => this.rtseeAuth.authenticate(res)))
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
signUp(credentials: IRtseeSignUpRequestOptions): Observable<IRTSeeSignUpResponse> {
|
|
37
|
-
return this.http
|
|
38
|
-
.post<IRTSeeSignUpResponse>(this.authConfiguration.getEndpointPathByEndpointName(AuthEndpointsKeys.SIGN_UP), credentials)
|
|
39
|
-
}
|
|
40
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
import { Injectable } from '@angular/core';
|
|
2
|
-
|
|
3
|
-
@Injectable({
|
|
4
|
-
providedIn: 'root'
|
|
5
|
-
})
|
|
6
|
-
export class UtilsService {
|
|
7
|
-
|
|
8
|
-
constructor() {
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
public static getKeysAsValueObject<T extends object>(obj: T): Record<string, string> { // object was {}
|
|
12
|
-
if (obj) {
|
|
13
|
-
return Object.keys(obj).reduce<Record<string, string>>((result, value) => {
|
|
14
|
-
result[value] = value;
|
|
15
|
-
return result;
|
|
16
|
-
}, {});
|
|
17
|
-
}
|
|
18
|
-
return {};
|
|
19
|
-
}
|
|
20
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
<div class="auth-container rtsee-form-container" >
|
|
2
|
-
<img [ngSrc]="authConfiguration.appLogo"
|
|
3
|
-
alt="Company Logo"
|
|
4
|
-
class="auth-logo"
|
|
5
|
-
height="37"
|
|
6
|
-
width="37"
|
|
7
|
-
/>
|
|
8
|
-
<h2 class="auth-title">Вхід в Особистий Кабінет</h2>
|
|
9
|
-
<p class="auth-title-description">Аби переглядати казки, увійдіть в свій особистий кабінет</p>
|
|
10
|
-
|
|
11
|
-
<form class="auth-form rtsee-form" [formGroup]="signInForm" (ngSubmit)="login()">
|
|
12
|
-
<div class="rtsee-form-field-container">
|
|
13
|
-
<p-inputgroup >
|
|
14
|
-
<p-floatlabel variant="on">
|
|
15
|
-
<input id="user-email"
|
|
16
|
-
pInputText
|
|
17
|
-
[formControl]="usernameField"
|
|
18
|
-
/>
|
|
19
|
-
<label for="user-email">Email</label>
|
|
20
|
-
</p-floatlabel>
|
|
21
|
-
</p-inputgroup>
|
|
22
|
-
@if (!usernameField.valid && usernameField.touched) {
|
|
23
|
-
<p-message class="rtsee-form-field-error-message"
|
|
24
|
-
severity="error"
|
|
25
|
-
variant="simple"
|
|
26
|
-
size="small"
|
|
27
|
-
>Email is invalid</p-message>
|
|
28
|
-
}
|
|
29
|
-
</div>
|
|
30
|
-
<div class="rtsee-form-field-container">
|
|
31
|
-
<p-inputgroup>
|
|
32
|
-
<p-floatlabel variant="on">
|
|
33
|
-
<p-password id="user-password"
|
|
34
|
-
[formControl]="passwordField"
|
|
35
|
-
[feedback]="false"
|
|
36
|
-
/>
|
|
37
|
-
<label for="user-password">Password</label>
|
|
38
|
-
</p-floatlabel>
|
|
39
|
-
</p-inputgroup>
|
|
40
|
-
|
|
41
|
-
@if (!passwordField.valid && passwordField.touched) {
|
|
42
|
-
<p-message class="rtsee-form-field-error-message"
|
|
43
|
-
severity="error"
|
|
44
|
-
variant="simple"
|
|
45
|
-
size="small"
|
|
46
|
-
>Password is required</p-message>
|
|
47
|
-
}
|
|
48
|
-
@if (serverSideError) {
|
|
49
|
-
<p-message class="rtsee-form-field-error-message"
|
|
50
|
-
severity="error"
|
|
51
|
-
variant="simple"
|
|
52
|
-
size="small"
|
|
53
|
-
>{{serverSideError}}</p-message>
|
|
54
|
-
}
|
|
55
|
-
</div>
|
|
56
|
-
<div class="rtsee-form-field-container">
|
|
57
|
-
<p-checkbox inputId="remember" [binary]="true" [formControl]="rememberField" />
|
|
58
|
-
<label for="remember" class="ml-2"> Remember me </label>
|
|
59
|
-
</div>
|
|
60
|
-
<div class="rtsee-form-field-container">
|
|
61
|
-
<a href="#"
|
|
62
|
-
[routerLink]="authConfiguration.getRoutePathSplit(AuthEndpointsKeys.FORGOT_PASSWORD)"
|
|
63
|
-
class="auth-deep-blue-sm-medium"
|
|
64
|
-
>Забули пароль?</a>
|
|
65
|
-
</div>
|
|
66
|
-
<div class="rtsee-form-submit-container">
|
|
67
|
-
<p-button type="submit"
|
|
68
|
-
label="Sign In"
|
|
69
|
-
[disabled]="loadInProgress"
|
|
70
|
-
/>
|
|
71
|
-
@if (loadInProgress) {
|
|
72
|
-
<p-progress-spinner class="rtsee-progress-spinner rtsee-progress-spinner-sm"></p-progress-spinner>
|
|
73
|
-
}
|
|
74
|
-
</div>
|
|
75
|
-
</form>
|
|
76
|
-
<p class="rtsee-form-label">
|
|
77
|
-
<span>Немає акаунту?</span>
|
|
78
|
-
<span> </span>
|
|
79
|
-
<a href="#"
|
|
80
|
-
[routerLink]="authConfiguration.getRoutePathSplit(AuthEndpointsKeys.SIGN_UP)"
|
|
81
|
-
class="auth-deep-blue-sm-medium"
|
|
82
|
-
>Створіть!</a>
|
|
83
|
-
</p>
|
|
84
|
-
</div>
|
|
@@ -1,120 +0,0 @@
|
|
|
1
|
-
import { Component } from '@angular/core';
|
|
2
|
-
import { Router, RouterLink } from '@angular/router';
|
|
3
|
-
import { FormBuilder, FormControl, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';
|
|
4
|
-
import { SignInForm, TypedReactiveForm } from '../types/auth-form.type';
|
|
5
|
-
import { NgOptimizedImage } from '@angular/common';
|
|
6
|
-
import { RTSeeAuthService } from '../services/auth.service';
|
|
7
|
-
import { AuthEndpointsKeys, RTSeeAuthConfiguration } from '@rtsee/auth';
|
|
8
|
-
import { ButtonModule } from 'primeng/button';
|
|
9
|
-
import { InputGroup } from 'primeng/inputgroup';
|
|
10
|
-
import { InputText } from 'primeng/inputtext';
|
|
11
|
-
import { Password } from 'primeng/password';
|
|
12
|
-
import { FloatLabel } from 'primeng/floatlabel';
|
|
13
|
-
import { Checkbox } from 'primeng/checkbox';
|
|
14
|
-
import { Message } from 'primeng/message';
|
|
15
|
-
import { ProgressSpinner } from 'primeng/progressspinner';
|
|
16
|
-
import {ServerSideError} from "../../../common/interfaces";
|
|
17
|
-
|
|
18
|
-
@Component({
|
|
19
|
-
selector: 'rtsee-sign-in',
|
|
20
|
-
templateUrl: './sign-in.component.html',
|
|
21
|
-
imports: [
|
|
22
|
-
NgOptimizedImage,
|
|
23
|
-
ReactiveFormsModule,
|
|
24
|
-
RouterLink,
|
|
25
|
-
ButtonModule,
|
|
26
|
-
InputGroup,
|
|
27
|
-
InputText,
|
|
28
|
-
Password,
|
|
29
|
-
FloatLabel,
|
|
30
|
-
Checkbox,
|
|
31
|
-
Message,
|
|
32
|
-
ProgressSpinner
|
|
33
|
-
],
|
|
34
|
-
standalone: true
|
|
35
|
-
})
|
|
36
|
-
export class SignInComponent {
|
|
37
|
-
public readonly signInForm: FormGroup<TypedReactiveForm<SignInForm>> = this.formBuilder.group<TypedReactiveForm<SignInForm>>({
|
|
38
|
-
username: this.formBuilder.nonNullable.control({
|
|
39
|
-
value: '',
|
|
40
|
-
disabled: false
|
|
41
|
-
},
|
|
42
|
-
{
|
|
43
|
-
validators: [ Validators.required, Validators.email ]
|
|
44
|
-
}),
|
|
45
|
-
password: this.formBuilder.nonNullable.control({
|
|
46
|
-
value: '',
|
|
47
|
-
disabled: false
|
|
48
|
-
}, { validators: [ Validators.required ]}),
|
|
49
|
-
remember: this.formBuilder.nonNullable.control(false),
|
|
50
|
-
});
|
|
51
|
-
public readonly authConfiguration: RTSeeAuthConfiguration;
|
|
52
|
-
protected readonly AuthEndpointsKeys = AuthEndpointsKeys;
|
|
53
|
-
public loadInProgress: boolean = false;
|
|
54
|
-
public serverSideError: string = '';
|
|
55
|
-
|
|
56
|
-
constructor(
|
|
57
|
-
private readonly formBuilder: FormBuilder,
|
|
58
|
-
private readonly router: Router,
|
|
59
|
-
public authService: RTSeeAuthService
|
|
60
|
-
) {
|
|
61
|
-
this.authConfiguration = this.authService.rtseeAuth.authConfiguration;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
get usernameField(): FormControl<string> {
|
|
65
|
-
return this.signInForm.get('username') as FormControl<string>;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
get passwordField(): FormControl<string> {
|
|
69
|
-
return this.signInForm.get('password') as FormControl<string>;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
get rememberField(): FormControl<boolean> {
|
|
73
|
-
return this.signInForm.get('remember') as FormControl<boolean>;
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
public login(): void {
|
|
77
|
-
if (this.signInForm.valid) {
|
|
78
|
-
this.disableFormFields();
|
|
79
|
-
this.authService.signIn(this.signInForm.getRawValue())
|
|
80
|
-
.subscribe({
|
|
81
|
-
next: (() => {
|
|
82
|
-
void this.router.navigate(this.authService.rtseeAuth.authConfiguration.defaultPostLoginRoute);
|
|
83
|
-
this.enableFormFields();
|
|
84
|
-
}),
|
|
85
|
-
error: ((error: ServerSideError) => {
|
|
86
|
-
console.log(error);
|
|
87
|
-
this.showServerSideErrorForXSeconds(error.error.message);
|
|
88
|
-
this.enableFormFields();
|
|
89
|
-
}),
|
|
90
|
-
complete: (() => {
|
|
91
|
-
this.enableFormFields();
|
|
92
|
-
})
|
|
93
|
-
});
|
|
94
|
-
} else {
|
|
95
|
-
this.signInForm.markAsTouched(); // this does not work after switching to "nonNullable" form fields
|
|
96
|
-
}
|
|
97
|
-
}
|
|
98
|
-
|
|
99
|
-
private showServerSideErrorForXSeconds(message: string, x: number = 3): void {
|
|
100
|
-
this.serverSideError = message;
|
|
101
|
-
|
|
102
|
-
setTimeout(() => {
|
|
103
|
-
this.serverSideError = '';
|
|
104
|
-
}, x * 1000); // we can do pop-up message instead
|
|
105
|
-
}
|
|
106
|
-
|
|
107
|
-
private disableFormFields(): void {
|
|
108
|
-
this.loadInProgress = true;
|
|
109
|
-
this.usernameField.disable();
|
|
110
|
-
this.passwordField.disable();
|
|
111
|
-
this.rememberField.disable();
|
|
112
|
-
}
|
|
113
|
-
|
|
114
|
-
private enableFormFields(): void {
|
|
115
|
-
this.loadInProgress = false;
|
|
116
|
-
this.usernameField.enable(); // fuck me, but [disabled]="loadInProgress" on the field no longer works :(
|
|
117
|
-
this.passwordField.enable();
|
|
118
|
-
this.rememberField.enable();
|
|
119
|
-
}
|
|
120
|
-
}
|
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
<div class="auth-container">
|
|
2
|
-
<img ngSrc="/assets/img.png" alt="Company Logo" class="logo" height="38" width="37"/>
|
|
3
|
-
<h2 class="auth-title">Реєстрація в Особистий Кабінет</h2>
|
|
4
|
-
<p class="auth-title-description">Створіть свій особистий кабінет, щоб переглядати казки</p>
|
|
5
|
-
|
|
6
|
-
<form class="auth-form" [formGroup]="signUpForm" (ngSubmit)="signUp()">
|
|
7
|
-
<!-- Email Field -->
|
|
8
|
-
<label for="sign-up-email" class="auth-sm-medium">Електрон пошта</label>
|
|
9
|
-
<input [formControlName]="signUpFormKeys.email"
|
|
10
|
-
type="email" id="sign-up-email"
|
|
11
|
-
placeholder="Введіть електронну пошту"
|
|
12
|
-
class="auth-input-container email-input"
|
|
13
|
-
/>
|
|
14
|
-
|
|
15
|
-
<!-- Password Field -->
|
|
16
|
-
<label for="sign-up-password" class="auth-sm-medium">Паро</label>
|
|
17
|
-
<input [formControlName]="signUpFormKeys.password"
|
|
18
|
-
type="password" id="sign-up-password"
|
|
19
|
-
placeholder="Створіть пароль"
|
|
20
|
-
class="auth-input-container password-input"
|
|
21
|
-
/>
|
|
22
|
-
|
|
23
|
-
<!-- Confirm Password Field -->
|
|
24
|
-
<label for="confirm-password" class="auth-sm-medium">Підтверд пароль</label>
|
|
25
|
-
<input [formControlName]="signUpFormKeys.passwordConfirmation"
|
|
26
|
-
type="password"
|
|
27
|
-
id="confirm-password"
|
|
28
|
-
placeholder="Підтвердьте пароль"
|
|
29
|
-
class="auth-input-container password-input"
|
|
30
|
-
/>
|
|
31
|
-
|
|
32
|
-
<!-- Terms and Conditions -->
|
|
33
|
-
<div class="auth-options">
|
|
34
|
-
<label class="auth-checkbox-label">
|
|
35
|
-
<input type="checkbox"
|
|
36
|
-
class="auth-deep-blue-sm-medium"
|
|
37
|
-
[formControlName]="signUpFormKeys.terms"
|
|
38
|
-
/>
|
|
39
|
-
Я погоджуюсь з <a href="#" class="auth-deep-blue-sm-medium">умовами використання</a>
|
|
40
|
-
</label>
|
|
41
|
-
</div>
|
|
42
|
-
|
|
43
|
-
<!-- Sign-Up Button -->
|
|
44
|
-
<button type="submit" class="auth-btn-container">Зареєструватись</button>
|
|
45
|
-
</form>
|
|
46
|
-
|
|
47
|
-
<!-- Redirect to Sign-In -->
|
|
48
|
-
<p class="auth-media-blue-gray-sm-normal">
|
|
49
|
-
Вже маєте акаунт? <a href="#" [routerLink]="authConfiguration.getRoutePathSplit(AuthEndpointsKeys.SIGN_IN)" class="auth-deep-blue-sm-medium">Увійдіть</a>
|
|
50
|
-
</p>
|
|
51
|
-
</div>
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { Component } from '@angular/core';
|
|
2
|
-
import {FormBuilder, FormGroup, ReactiveFormsModule, Validators} from '@angular/forms';
|
|
3
|
-
import { SignUpForm, TypedReactiveForm } from '../types/auth-form.type';
|
|
4
|
-
import { UtilsService } from '../services/utils.service';
|
|
5
|
-
import {ConfirmPasswordValidator} from "../validators/form-fields-validators";
|
|
6
|
-
import {RouterLink} from "@angular/router";
|
|
7
|
-
import {NgOptimizedImage} from "@angular/common";
|
|
8
|
-
import {RTSeeAuthService} from "../services/auth.service";
|
|
9
|
-
import {RTSeeAuthConfiguration, AuthEndpointsKeys} from "@rtsee/auth";
|
|
10
|
-
|
|
11
|
-
@Component({
|
|
12
|
-
selector: 'rtsee-sign-up',
|
|
13
|
-
templateUrl: './sign-up.component.html',
|
|
14
|
-
imports: [
|
|
15
|
-
ReactiveFormsModule,
|
|
16
|
-
RouterLink,
|
|
17
|
-
NgOptimizedImage
|
|
18
|
-
],
|
|
19
|
-
standalone: true
|
|
20
|
-
})
|
|
21
|
-
export class SignUpComponent {
|
|
22
|
-
public readonly signUpForm: FormGroup<TypedReactiveForm<SignUpForm>>;
|
|
23
|
-
public readonly signUpFormKeys: Record<keyof SignUpForm, string>;
|
|
24
|
-
public readonly authConfiguration: RTSeeAuthConfiguration;
|
|
25
|
-
|
|
26
|
-
constructor(
|
|
27
|
-
private readonly formBuilder: FormBuilder,
|
|
28
|
-
private authService: RTSeeAuthService
|
|
29
|
-
) {
|
|
30
|
-
this.signUpForm = this.formBuilder.group<TypedReactiveForm<SignUpForm>>({
|
|
31
|
-
email: this.formBuilder.control('', { validators: [Validators.required, Validators.email] }),
|
|
32
|
-
password: this.formBuilder.control('', { validators: [Validators.required, Validators.minLength(6)] }),
|
|
33
|
-
passwordConfirmation: this.formBuilder.control('', {
|
|
34
|
-
validators: [
|
|
35
|
-
Validators.required,
|
|
36
|
-
Validators.minLength(6)
|
|
37
|
-
]
|
|
38
|
-
}),
|
|
39
|
-
terms: this.formBuilder.control(false, { nonNullable: true,
|
|
40
|
-
validators: [Validators.requiredTrue]
|
|
41
|
-
}),
|
|
42
|
-
}, { validators: [ ConfirmPasswordValidator.MatchFields ] });
|
|
43
|
-
this.signUpFormKeys = UtilsService.getKeysAsValueObject(this.signUpForm.getRawValue());
|
|
44
|
-
this.authConfiguration = this.authService.rtseeAuth.authConfiguration;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
public signUp(): void {
|
|
48
|
-
if (this.signUpForm.valid) {
|
|
49
|
-
const formValues: SignUpForm = this.signUpForm.getRawValue();
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
this.authService.signUp({
|
|
54
|
-
email: formValues.email!,
|
|
55
|
-
password: formValues.password!,
|
|
56
|
-
terms: formValues.terms!
|
|
57
|
-
})
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
// Call sign-up API
|
|
62
|
-
// this.authService.signUp(formValue);
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
protected readonly AuthEndpointsKeys = AuthEndpointsKeys;
|
|
67
|
-
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { FormArray, FormControl, FormGroup } from '@angular/forms';
|
|
2
|
-
|
|
3
|
-
export type SignUpForm = {
|
|
4
|
-
email: string | null;
|
|
5
|
-
password: string | null;
|
|
6
|
-
passwordConfirmation: string | null;
|
|
7
|
-
terms: boolean;
|
|
8
|
-
};
|
|
9
|
-
|
|
10
|
-
export type TypedReactiveForm<T> = {
|
|
11
|
-
[Key in keyof T]: T[Key] extends Array<infer Item>
|
|
12
|
-
? Item extends object
|
|
13
|
-
? FormArray<FormGroup<TypedReactiveForm<Item>>>
|
|
14
|
-
: FormControl<T[Key]>
|
|
15
|
-
: FormControl<T[Key]>;
|
|
16
|
-
};
|
|
17
|
-
|
|
18
|
-
export type ResetPasswordForm = {
|
|
19
|
-
password: string;
|
|
20
|
-
passwordConfirm: string;
|
|
21
|
-
};
|
|
22
|
-
|
|
23
|
-
export type ConfirmPasswordForm = {
|
|
24
|
-
password: string;
|
|
25
|
-
newPassword: string;
|
|
26
|
-
};
|
|
27
|
-
|
|
28
|
-
export type ForgotPasswordForm = {
|
|
29
|
-
email: string;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export type SignInForm = {
|
|
33
|
-
username: string;
|
|
34
|
-
password: string;
|
|
35
|
-
remember: boolean;
|
|
36
|
-
};
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import {AbstractControl, ValidationErrors} from '@angular/forms';
|
|
2
|
-
|
|
3
|
-
export class ConfirmPasswordValidator {
|
|
4
|
-
/**
|
|
5
|
-
* Check matching password with confirm password
|
|
6
|
-
* @param control AbstractControl
|
|
7
|
-
*/
|
|
8
|
-
static MatchFields(control: AbstractControl): ValidationErrors | null {
|
|
9
|
-
const passwordField: AbstractControl | null = control.get('password');
|
|
10
|
-
const passwordConfirmationField: AbstractControl | null = control.get('passwordConfirmation');
|
|
11
|
-
|
|
12
|
-
if (!passwordField || ! passwordConfirmationField) {
|
|
13
|
-
throw new Error('MatchFieldsValidator unable to find password controls!');
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
const password: string = passwordField.getRawValue() as string;
|
|
17
|
-
const passwordConfirmation: string = passwordConfirmationField.getRawValue() as string;
|
|
18
|
-
|
|
19
|
-
if (password !== passwordConfirmation) {
|
|
20
|
-
return {
|
|
21
|
-
confirmPassword: true
|
|
22
|
-
};
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
return null;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
<p>vendors works!</p>
|