@processpuzzle/auth 0.0.1 → 0.0.3

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 CHANGED
@@ -20,8 +20,8 @@ The `AuthButtonComponent` is a versatile authentication button that displays dif
20
20
 
21
21
  - Displays a person icon button that opens a dropdown menu
22
22
  - Dynamically shows different menu options based on authentication status
23
- - When not authenticated, shows Login and Register options
24
- - When authenticated, shows My Profile and Logout options
23
+ - When not authenticated, it shows Login and Register options
24
+ - When authenticated, it shows My Profile and Logout options
25
25
  - Integrates with Angular Router for navigation to auth pages
26
26
  - Uses Angular Material components for a consistent UI experience
27
27
 
@@ -0,0 +1,42 @@
1
+ {
2
+ "button": {
3
+ "login": "Anmelden",
4
+ "logout": "Abmelden",
5
+ "register": "Registrieren",
6
+ "my_profile": "Mein Profil"
7
+ },
8
+ "login-form": {
9
+ "title": "Anmelden",
10
+ "email_label": "E-Mail",
11
+ "email_err_required": "E-Mail ist erforderlich",
12
+ "email_err_invalid": "Bitte geben Sie eine gültige E-Mail-Adresse ein",
13
+ "password_label": "Passwort",
14
+ "password_err_required": "Passwort ist erforderlich",
15
+ "create_account_button": "Konto erstellen",
16
+ "sign_in_button": "Anmelden",
17
+ "signing_in_button": "Anmeldung läuft...",
18
+ "google_button": "Mit Google anmelden"
19
+ },
20
+ "logout-dialog": {
21
+ "title": "Abmeldung bestätigen",
22
+ "content": "Sind Sie sicher, dass Sie sich abmelden möchten?",
23
+ "cancel_button": "Abbrechen",
24
+ "logout_button": "Abmelden"
25
+ },
26
+ "registration-form": {
27
+ "title": "Konto erstellen",
28
+ "email_label": "E-Mail",
29
+ "email_placeholder": "Geben Sie Ihre E-Mail-Adresse ein",
30
+ "email_err_required": "E-Mail ist erforderlich",
31
+ "email_err_invalid": "Bitte geben Sie eine gültige E-Mail-Adresse ein",
32
+ "password_label": "Passwort",
33
+ "password_placeholder": "Geben Sie Ihr Passwort ein",
34
+ "password_err_required": "Passwort ist erforderlich",
35
+ "password_err_min_length": "Das Passwort muss mindestens 6 Zeichen lang sein",
36
+ "password_confirm_label": "Passwort bestätigen",
37
+ "password_confirm_placeholder": "Bestätigen Sie Ihr Passwort",
38
+ "password_err_mismatch": "Die Passwörter stimmen nicht überein",
39
+ "create_button": "Konto erstellen",
40
+ "sign_in_button": "Haben Sie bereits ein Konto? Anmelden"
41
+ }
42
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "button": {
3
+ "login": "Login",
4
+ "logout": "Logout",
5
+ "register": "Register",
6
+ "my_profile": "My Profile"
7
+ },
8
+ "login-form": {
9
+ "title": "Login",
10
+ "email_label": "Email",
11
+ "email_err_required": "Email is required",
12
+ "email_err_invalid": "Please enter a valid email",
13
+ "password_label": "Password",
14
+ "password_err_required": "Password is required",
15
+ "create_account_button": "Create Account",
16
+ "sign_in_button": "Sign In",
17
+ "signing_in_button": "Signing in...",
18
+ "google_button": "Sign in with Google"
19
+ },
20
+ "logout-dialog": {
21
+ "title": "Confirm Logout",
22
+ "content": " Are you sure you want to log out?",
23
+ "cancel_button": "Cancel",
24
+ "logout_button": "Logout"
25
+ },
26
+ "registration-form": {
27
+ "title": "Create Account",
28
+ "email_label": "Email",
29
+ "email_placeholder": "Enter your email",
30
+ "email_err_required": "Email is required",
31
+ "email_err_invalid": "Please enter a valid email address",
32
+ "password_label": "Password",
33
+ "password_placeholder": "Enter your password",
34
+ "password_err_required": "Password is required",
35
+ "password_err_min_length": "Password must be at least 6 characters long",
36
+ "password_confirm_label": "Confirm Password",
37
+ "password_confirm_placeholder": "Confirm your password",
38
+ "password_err_mismatch": "Passwords do not match",
39
+ "create_button": "Create Account",
40
+ "sign_in_button": "Already have an account? Sign in"
41
+ }
42
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "button": {
3
+ "login": "Iniciar sesión",
4
+ "logout": "Cerrar sesión",
5
+ "register": "Registrarse",
6
+ "my_profile": "Mi perfil"
7
+ },
8
+ "login-form": {
9
+ "title": "Iniciar sesión",
10
+ "email_label": "Correo electrónico",
11
+ "email_err_required": "El correo electrónico es obligatorio",
12
+ "email_err_invalid": "Por favor, introduce un correo electrónico válido",
13
+ "password_label": "Contraseña",
14
+ "password_err_required": "La contraseña es obligatoria",
15
+ "create_account_button": "Crear cuenta",
16
+ "sign_in_button": "Iniciar sesión",
17
+ "signing_in_button": "Iniciando sesión...",
18
+ "google_button": "Iniciar sesión con Google"
19
+ },
20
+ "logout-dialog": {
21
+ "title": "Confirmar cierre de sesión",
22
+ "content": "¿Estás seguro de que quieres cerrar sesión?",
23
+ "cancel_button": "Cancelar",
24
+ "logout_button": "Cerrar sesión"
25
+ },
26
+ "registration-form": {
27
+ "title": "Crear cuenta",
28
+ "email_label": "Correo electrónico",
29
+ "email_placeholder": "Introduce tu correo electrónico",
30
+ "email_err_required": "El correo electrónico es obligatorio",
31
+ "email_err_invalid": "Por favor, introduce un correo electrónico válido",
32
+ "password_label": "Contraseña",
33
+ "password_placeholder": "Introduce tu contraseña",
34
+ "password_err_required": "La contraseña es obligatoria",
35
+ "password_err_min_length": "La contraseña debe tener al menos 6 caracteres",
36
+ "password_confirm_label": "Confirmar contraseña",
37
+ "password_confirm_placeholder": "Confirma tu contraseña",
38
+ "password_err_mismatch": "Las contraseñas no coinciden",
39
+ "create_button": "Crear cuenta",
40
+ "sign_in_button": "¿Ya tienes una cuenta? Inicia sesión"
41
+ }
42
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "button": {
3
+ "login": "Connexion",
4
+ "logout": "Déconnexion",
5
+ "register": "S'inscrire",
6
+ "my_profile": "Mon Profil"
7
+ },
8
+ "login-form": {
9
+ "title": "Connexion",
10
+ "email_label": "Email",
11
+ "email_err_required": "L'email est requis",
12
+ "email_err_invalid": "Veuillez entrer un email valide",
13
+ "password_label": "Mot de passe",
14
+ "password_err_required": "Le mot de passe est requis",
15
+ "create_account_button": "Créer un compte",
16
+ "sign_in_button": "Se connecter",
17
+ "signing_in_button": "Connexion en cours...",
18
+ "google_button": "Se connecter avec Google"
19
+ },
20
+ "logout-dialog": {
21
+ "title": "Confirmer la déconnexion",
22
+ "content": "Êtes-vous sûr de vouloir vous déconnecter?",
23
+ "cancel_button": "Annuler",
24
+ "logout_button": "Déconnexion"
25
+ },
26
+ "registration-form": {
27
+ "title": "Créer un compte",
28
+ "email_label": "Email",
29
+ "email_placeholder": "Entrez votre email",
30
+ "email_err_required": "L'email est requis",
31
+ "email_err_invalid": "Veuillez entrer une adresse email valide",
32
+ "password_label": "Mot de passe",
33
+ "password_placeholder": "Entrez votre mot de passe",
34
+ "password_err_required": "Le mot de passe est requis",
35
+ "password_err_min_length": "Le mot de passe doit contenir au moins 6 caractères",
36
+ "password_confirm_label": "Confirmer le mot de passe",
37
+ "password_confirm_placeholder": "Confirmez votre mot de passe",
38
+ "password_err_mismatch": "Les mots de passe ne correspondent pas",
39
+ "create_button": "Créer un compte",
40
+ "sign_in_button": "Vous avez déjà un compte? Connectez-vous"
41
+ }
42
+ }
@@ -0,0 +1,42 @@
1
+ {
2
+ "button": {
3
+ "login": "Bejelentkezés",
4
+ "logout": "Kijelentkezés",
5
+ "register": "Regisztráció",
6
+ "my_profile": "Profilom"
7
+ },
8
+ "login-form": {
9
+ "title": "Bejelentkezés",
10
+ "email_label": "Email",
11
+ "email_err_required": "Az email megadása kötelező",
12
+ "email_err_invalid": "Kérjük, adjon meg egy érvényes email címet",
13
+ "password_label": "Jelszó",
14
+ "password_err_required": "A jelszó megadása kötelező",
15
+ "create_account_button": "Fiók létrehozása",
16
+ "sign_in_button": "Bejelentkezés",
17
+ "signing_in_button": "Bejelentkezés folyamatban...",
18
+ "google_button": "Bejelentkezés Google-lal"
19
+ },
20
+ "logout-dialog": {
21
+ "title": "Kijelentkezés megerősítése",
22
+ "content": "Biztosan ki szeretne jelentkezni?",
23
+ "cancel_button": "Mégsem",
24
+ "logout_button": "Kijelentkezés"
25
+ },
26
+ "registration-form": {
27
+ "title": "Fiók létrehozása",
28
+ "email_label": "Email",
29
+ "email_placeholder": "Adja meg az email címét",
30
+ "email_err_required": "Az email megadása kötelező",
31
+ "email_err_invalid": "Kérjük, adjon meg egy érvényes email címet",
32
+ "password_label": "Jelszó",
33
+ "password_placeholder": "Adja meg a jelszavát",
34
+ "password_err_required": "A jelszó megadása kötelező",
35
+ "password_err_min_length": "A jelszónak legalább 6 karakter hosszúnak kell lennie",
36
+ "password_confirm_label": "Jelszó megerősítése",
37
+ "password_confirm_placeholder": "Erősítse meg a jelszavát",
38
+ "password_err_mismatch": "A jelszavak nem egyeznek",
39
+ "create_button": "Fiók létrehozása",
40
+ "sign_in_button": "Már van fiókja? Jelentkezzen be"
41
+ }
42
+ }
@@ -0,0 +1,313 @@
1
+ import * as i0 from '@angular/core';
2
+ import { inject, signal, Component, computed, Injectable } from '@angular/core';
3
+ import { Auth, signInWithEmailAndPassword, GoogleAuthProvider, signInWithPopup, createUserWithEmailAndPassword, authState } from '@angular/fire/auth';
4
+ import { Router, RouterLink } from '@angular/router';
5
+ import * as i2 from '@angular/forms';
6
+ import { FormBuilder, Validators, ReactiveFormsModule, NonNullableFormBuilder } from '@angular/forms';
7
+ import { MatError, MatFormField, MatSuffix } from '@angular/material/form-field';
8
+ import { MatInput, MatLabel } from '@angular/material/input';
9
+ import * as i3 from '@angular/material/button';
10
+ import { MatButton, MatIconButton, MatButtonModule } from '@angular/material/button';
11
+ import * as i2$1 from '@angular/material/icon';
12
+ import { MatIcon, MatIconModule } from '@angular/material/icon';
13
+ import { MatDivider } from '@angular/material/divider';
14
+ import * as i1$1 from '@angular/common';
15
+ import { NgIf, CommonModule } from '@angular/common';
16
+ import * as i1 from '@angular/material/snack-bar';
17
+ import { TranslocoDirective, provideTranslocoScope } from '@jsverse/transloco';
18
+ import { MatProgressBar } from '@angular/material/progress-bar';
19
+ import { NavigateBackService } from '@processpuzzle/widgets';
20
+ import { MatDialogTitle, MatDialogContent, MatDialogActions } from '@angular/material/dialog';
21
+ import { toSignal } from '@angular/core/rxjs-interop';
22
+ import { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu';
23
+ import { SubstringPipe } from '@processpuzzle/util';
24
+
25
+ class LoginComponent {
26
+ snackBar;
27
+ auth = inject(Auth);
28
+ fb = inject(FormBuilder);
29
+ router = inject(Router);
30
+ loginForm;
31
+ isLoading = signal(false);
32
+ errorMessage = signal('');
33
+ hidePassword = true;
34
+ constructor(snackBar) {
35
+ this.snackBar = snackBar;
36
+ this.loginForm = this.fb.group({
37
+ email: ['', [Validators.required, Validators.email]],
38
+ password: ['', Validators.required],
39
+ });
40
+ }
41
+ async onSubmit() {
42
+ if (this.loginForm.invalid)
43
+ return;
44
+ this.isLoading.set(true);
45
+ try {
46
+ const { email, password } = this.loginForm.value;
47
+ await signInWithEmailAndPassword(this.auth, email, password);
48
+ await this.router.navigate(['/']);
49
+ }
50
+ catch (error) {
51
+ this.snackBar.open(this.getErrorMessage(error.code), 'Close', { duration: 5000, panelClass: ['error-snackbar'] });
52
+ }
53
+ finally {
54
+ this.isLoading.set(false);
55
+ this.errorMessage.set('');
56
+ }
57
+ }
58
+ async signInWithGoogle() {
59
+ this.isLoading.set(true);
60
+ try {
61
+ const provider = new GoogleAuthProvider();
62
+ await signInWithPopup(this.auth, provider);
63
+ await this.router.navigate(['/']); // Navigate to home page after successful login
64
+ }
65
+ catch (error) {
66
+ this.snackBar.open(this.getErrorMessage(error.code), 'Close', { duration: 5000, panelClass: ['error-snackbar'] });
67
+ }
68
+ finally {
69
+ this.isLoading.set(false);
70
+ this.errorMessage.set('');
71
+ }
72
+ }
73
+ getErrorMessage(errorCode) {
74
+ switch (errorCode) {
75
+ case 'auth/invalid-email':
76
+ return 'Invalid email address';
77
+ case 'auth/user-disabled':
78
+ return 'This account has been disabled';
79
+ case 'auth/user-not-found':
80
+ return 'No account found with this email';
81
+ case 'auth/wrong-password':
82
+ return 'Invalid password';
83
+ case 'auth/popup-closed-by-user':
84
+ return 'Sign-in popup was closed before completion';
85
+ default:
86
+ return 'An error occurred during sign in';
87
+ }
88
+ }
89
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: LoginComponent, deps: [{ token: i1.MatSnackBar }], target: i0.ɵɵFactoryTarget.Component });
90
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: LoginComponent, isStandalone: true, selector: "pp-login", providers: [provideTranslocoScope('auth')], ngImport: i0, template: "<div class=\"login-container\">\n <ng-container *transloco=\"let t;\">\n <h2>{{t('auth.login-form.title')}}</h2>\n\n <form [formGroup]=\"loginForm\" (ngSubmit)=\"onSubmit()\" aria-label=\"Login Form\">\n <mat-form-field appearance=\"outline\">\n <mat-label>{{t('auth.login-form.email_label')}}</mat-label>\n <input matInput type=\"email\" formControlName=\"email\" placeholder=\"Enter your email\">\n <mat-error *ngIf=\"loginForm.get('email')?.hasError('required')\">{{t('auth.login-form.email_err_required')}}</mat-error>\n <mat-error *ngIf=\"loginForm.get('email')?.hasError('email')\">{{t('auth.login-form.email_err_invalid')}}</mat-error>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\">\n <mat-label>{{t('auth.login-form.password_label')}}</mat-label>\n <input matInput [type]=\"hidePassword ? 'password' : 'text'\" formControlName=\"password\">\n <button mat-icon-button matSuffix type=\"button\" (click)=\"hidePassword = !hidePassword\" aria-label=\"Toggle Password Visibility\">\n <mat-icon>{{hidePassword ? 'visibility_off' : 'visibility'}}</mat-icon>\n </button>\n <mat-error *ngIf=\"loginForm.get('password')?.hasError('required')\">{{t('auth.login-form.password_err_required')}}</mat-error>\n </mat-form-field>\n\n <div class=\"actions\">\n <button mat-raised-button color=\"secondary\" routerLink=\"/auth/register\">{{t('auth.login-form.create_account_button')}}</button>\n <button mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"loginForm.invalid || isLoading()\">{{ isLoading() ? t('auth.login-form.signing_in_button') : t('auth.login-form.sign_in_button') }}</button>\n </div>\n </form>\n\n <mat-divider class=\"divider\">OR</mat-divider>\n\n <button mat-stroked-button (click)=\"signInWithGoogle()\" [disabled]=\"isLoading()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 48 48\">\n <path fill=\"#FFC107\" d=\"M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12\ts5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24s8.955,20,20,20\ts20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z\"/>\n <path fill=\"#FF3D00\" d=\"M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039\tl5.657-5.657C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z\"/>\n <path fill=\"#4CAF50\" d=\"M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36\tc-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z\"/>\n <path fill=\"#1976D2\" d=\"M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571\tc0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z\"/>\n </svg>\n {{t('auth.login-form.google_button')}}\n </button>\n <div class=\"error-message\" *ngIf=\"errorMessage\">{{ errorMessage() }}</div>\n </ng-container>\n</div>\n", styles: [".login-container{max-width:400px;margin:2rem auto;padding:2rem;border-radius:8px;box-shadow:0 2px 4px #0000001a}h2{text-align:center;margin-bottom:2rem}form{display:flex;flex-direction:column;gap:1rem}mat-form-field{width:100%}.actions{display:flex;justify-content:center;margin-top:1rem;gap:10px}.divider{margin:2rem 0;text-align:center}button[mat-stroked-button]{width:100%;margin-top:1rem;display:flex;align-items:center;justify-content:center;gap:.5rem}.google-icon{width:18px;height:18px}.error-message{color:red;text-align:center;margin-top:1rem}.mat-form-field-suffix{visibility:visible!important;opacity:1!important;display:flex!important}.mat-form-field-suffix button{z-index:10}\n"], dependencies: [{ kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "component", type: MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "directive", type: MatSuffix, selector: "[matSuffix], [matIconSuffix], [matTextSuffix]", inputs: ["matTextSuffix"] }, { kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }] });
91
+ }
92
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: LoginComponent, decorators: [{
93
+ type: Component,
94
+ args: [{ selector: 'pp-login', imports: [MatButton, MatDivider, MatError, MatFormField, MatIcon, MatIconButton, MatInput, MatLabel, MatSuffix, ReactiveFormsModule, NgIf, RouterLink, TranslocoDirective], providers: [provideTranslocoScope('auth')], template: "<div class=\"login-container\">\n <ng-container *transloco=\"let t;\">\n <h2>{{t('auth.login-form.title')}}</h2>\n\n <form [formGroup]=\"loginForm\" (ngSubmit)=\"onSubmit()\" aria-label=\"Login Form\">\n <mat-form-field appearance=\"outline\">\n <mat-label>{{t('auth.login-form.email_label')}}</mat-label>\n <input matInput type=\"email\" formControlName=\"email\" placeholder=\"Enter your email\">\n <mat-error *ngIf=\"loginForm.get('email')?.hasError('required')\">{{t('auth.login-form.email_err_required')}}</mat-error>\n <mat-error *ngIf=\"loginForm.get('email')?.hasError('email')\">{{t('auth.login-form.email_err_invalid')}}</mat-error>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\">\n <mat-label>{{t('auth.login-form.password_label')}}</mat-label>\n <input matInput [type]=\"hidePassword ? 'password' : 'text'\" formControlName=\"password\">\n <button mat-icon-button matSuffix type=\"button\" (click)=\"hidePassword = !hidePassword\" aria-label=\"Toggle Password Visibility\">\n <mat-icon>{{hidePassword ? 'visibility_off' : 'visibility'}}</mat-icon>\n </button>\n <mat-error *ngIf=\"loginForm.get('password')?.hasError('required')\">{{t('auth.login-form.password_err_required')}}</mat-error>\n </mat-form-field>\n\n <div class=\"actions\">\n <button mat-raised-button color=\"secondary\" routerLink=\"/auth/register\">{{t('auth.login-form.create_account_button')}}</button>\n <button mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"loginForm.invalid || isLoading()\">{{ isLoading() ? t('auth.login-form.signing_in_button') : t('auth.login-form.sign_in_button') }}</button>\n </div>\n </form>\n\n <mat-divider class=\"divider\">OR</mat-divider>\n\n <button mat-stroked-button (click)=\"signInWithGoogle()\" [disabled]=\"isLoading()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 48 48\">\n <path fill=\"#FFC107\" d=\"M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12\ts5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24s8.955,20,20,20\ts20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z\"/>\n <path fill=\"#FF3D00\" d=\"M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039\tl5.657-5.657C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z\"/>\n <path fill=\"#4CAF50\" d=\"M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36\tc-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z\"/>\n <path fill=\"#1976D2\" d=\"M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571\tc0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z\"/>\n </svg>\n {{t('auth.login-form.google_button')}}\n </button>\n <div class=\"error-message\" *ngIf=\"errorMessage\">{{ errorMessage() }}</div>\n </ng-container>\n</div>\n", styles: [".login-container{max-width:400px;margin:2rem auto;padding:2rem;border-radius:8px;box-shadow:0 2px 4px #0000001a}h2{text-align:center;margin-bottom:2rem}form{display:flex;flex-direction:column;gap:1rem}mat-form-field{width:100%}.actions{display:flex;justify-content:center;margin-top:1rem;gap:10px}.divider{margin:2rem 0;text-align:center}button[mat-stroked-button]{width:100%;margin-top:1rem;display:flex;align-items:center;justify-content:center;gap:.5rem}.google-icon{width:18px;height:18px}.error-message{color:red;text-align:center;margin-top:1rem}.mat-form-field-suffix{visibility:visible!important;opacity:1!important;display:flex!important}.mat-form-field-suffix button{z-index:10}\n"] }]
95
+ }], ctorParameters: () => [{ type: i1.MatSnackBar }] });
96
+
97
+ class MyProfileComponent {
98
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MyProfileComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
99
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: MyProfileComponent, isStandalone: true, selector: "pp-my-profile", providers: [provideTranslocoScope('auth')], ngImport: i0, template: "<h1>My profile</h1>\n", styles: [""] });
100
+ }
101
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: MyProfileComponent, decorators: [{
102
+ type: Component,
103
+ args: [{ selector: 'pp-my-profile', imports: [], providers: [provideTranslocoScope('auth')], template: "<h1>My profile</h1>\n" }]
104
+ }] });
105
+
106
+ class RegistrationComponent {
107
+ snackBar;
108
+ auth = inject(Auth);
109
+ fb = inject(NonNullableFormBuilder);
110
+ navigateBack = inject(NavigateBackService);
111
+ registerForm;
112
+ isLoading = signal(false);
113
+ errorMessage = signal('');
114
+ hidePassword = true;
115
+ hideConfirmPassword = true;
116
+ constructor(snackBar) {
117
+ this.snackBar = snackBar;
118
+ this.registerForm = this.fb.group({
119
+ email: ['', [Validators.required, Validators.email]],
120
+ password: ['', [Validators.required, Validators.minLength(6)]],
121
+ confirmPassword: ['', Validators.required],
122
+ }, {
123
+ validators: [this.passwordMatchValidator],
124
+ });
125
+ }
126
+ passwordMatchValidator() {
127
+ return (form) => {
128
+ const password = form.get('password')?.value;
129
+ const confirmPassword = form.get('confirmPassword')?.value;
130
+ if (password !== confirmPassword) {
131
+ return { passwordMismatch: true };
132
+ }
133
+ return null;
134
+ };
135
+ }
136
+ async onSubmit() {
137
+ if (this.registerForm.invalid)
138
+ return;
139
+ this.isLoading.set(true);
140
+ try {
141
+ const { email, password } = this.registerForm.value;
142
+ await createUserWithEmailAndPassword(this.auth, email, password);
143
+ }
144
+ catch (error) {
145
+ this.snackBar.open(this.getErrorMessage(error.code), 'Close', {
146
+ duration: 5000,
147
+ panelClass: ['error-snackbar'],
148
+ });
149
+ }
150
+ finally {
151
+ this.isLoading.set(false);
152
+ this.errorMessage.set('');
153
+ this.navigateBack.goBack();
154
+ }
155
+ }
156
+ getErrorMessage(errorCode) {
157
+ switch (errorCode) {
158
+ case 'auth/email-already-in-use':
159
+ return 'This email address is already registered';
160
+ case 'auth/invalid-email':
161
+ return 'Please enter a valid email address';
162
+ case 'auth/operation-not-allowed':
163
+ return 'Email/password registration is not enabled';
164
+ case 'auth/weak-password':
165
+ return 'Please choose a stronger password';
166
+ default:
167
+ return 'An error occurred during registration. Please try again.';
168
+ }
169
+ }
170
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: RegistrationComponent, deps: [{ token: i1.MatSnackBar }], target: i0.ɵɵFactoryTarget.Component });
171
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: RegistrationComponent, isStandalone: true, selector: "pp-registration", providers: [provideTranslocoScope('auth')], ngImport: i0, template: "<div class=\"registration-container\">\n <ng-container *transloco=\"let t;\">\n <h1>{{t('auth.registration-form.title')}}</h1>\n\n <form [formGroup]=\"registerForm\" (ngSubmit)=\"onSubmit()\" aria-label=\"Registration Form\">\n <mat-progress-bar *ngIf=\"isLoading()\" mode=\"indeterminate\"></mat-progress-bar>\n\n <mat-form-field appearance=\"outline\">\n <mat-label>{{t('auth.registration-form.email_label')}}</mat-label>\n <input matInput type=\"email\" formControlName=\"email\" [placeholder]=\"t('auth.registration-form.email_placeholder')\">\n <mat-error *ngIf=\"registerForm.get('email')?.errors?.['required']\">{{t('auth.registration-form.email_err_required')}}</mat-error>\n <mat-error *ngIf=\"registerForm.get('email')?.errors?.['email']\">{{t('auth.registration-form.email_err_invalid')}}</mat-error>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\">\n <mat-label>{{t('auth.registration-form.password_label')}}</mat-label>\n <input matInput [type]=\"hidePassword ? 'password' : 'text'\" formControlName=\"password\" [placeholder]=\"t('auth.registration-form.password_placeholder')\">\n <button mat-icon-button type=\"button\" matSuffix (click)=\"hidePassword = !hidePassword\">\n <mat-icon>{{hidePassword ? 'visibility_off' : 'visibility'}}</mat-icon>\n </button>\n <mat-error *ngIf=\"registerForm.get('password')?.errors?.['required']\">{{t('auth.registration-form.password_err_required')}}</mat-error>\n <mat-error *ngIf=\"registerForm.get('password')?.errors?.['minlength']\">{{t('auth.registration-form.password_err_min_length')}}</mat-error>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\">\n <mat-label>{{t('auth.registration-form.password_confirm_label')}}</mat-label>\n <input matInput [type]=\"hideConfirmPassword ? 'password' : 'text'\" formControlName=\"confirmPassword\" [placeholder]=\"t('auth.registration-form.password_confirm_placeholder')\">\n <button mat-icon-button type=\"button\" matSuffix (click)=\"hideConfirmPassword = !hideConfirmPassword\">\n <mat-icon>{{hideConfirmPassword ? 'visibility_off' : 'visibility'}}</mat-icon>\n </button>\n <mat-error *ngIf=\"registerForm.errors?.['passwordMismatch']\">{{t('auth.registration-form.password_confirm_err_mismatch')}}</mat-error>\n </mat-form-field>\n\n <div class=\"form-actions\">\n <button mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"registerForm.invalid || isLoading()\">{{t('auth.registration-form.create_button')}}</button>\n <button mat-button type=\"button\" routerLink=\"/auth/login\" [disabled]=\"isLoading()\">{{t('auth.registration-form.sign_in_button')}}</button>\n </div>\n\n <mat-error *ngIf=\"errorMessage() !== ''\" class=\"server-error\">{{ errorMessage() }}</mat-error>\n </form>\n </ng-container>\n</div>\n", styles: [".registration-container{max-width:400px;margin:2rem auto;padding:2rem}form{display:flex;flex-direction:column;gap:1rem}.form-actions{display:flex;flex-direction:column;gap:.5rem;margin-top:1rem}.server-error{margin-top:1rem;text-align:center}h1{text-align:center;margin-bottom:2rem}\n"], dependencies: [{ kind: "ngmodule", type: ReactiveFormsModule }, { kind: "directive", type: i2.ɵNgNoValidate, selector: "form:not([ngNoForm]):not([ngNativeValidate])" }, { kind: "directive", type: i2.DefaultValueAccessor, selector: "input:not([type=checkbox])[formControlName],textarea[formControlName],input:not([type=checkbox])[formControl],textarea[formControl],input:not([type=checkbox])[ngModel],textarea[ngModel],[ngDefaultControl]" }, { kind: "directive", type: i2.NgControlStatus, selector: "[formControlName],[ngModel],[formControl]" }, { kind: "directive", type: i2.NgControlStatusGroup, selector: "[formGroupName],[formArrayName],[ngModelGroup],[formGroup],form:not([ngNoForm]),[ngForm]" }, { kind: "directive", type: i2.FormGroupDirective, selector: "[formGroup]", inputs: ["formGroup"], outputs: ["ngSubmit"], exportAs: ["ngForm"] }, { kind: "directive", type: i2.FormControlName, selector: "[formControlName]", inputs: ["formControlName", "disabled", "ngModel"], outputs: ["ngModelChange"] }, { kind: "component", type: MatProgressBar, selector: "mat-progress-bar", inputs: ["color", "value", "bufferValue", "mode"], outputs: ["animationEnd"], exportAs: ["matProgressBar"] }, { kind: "component", type: MatFormField, selector: "mat-form-field", inputs: ["hideRequiredMarker", "color", "floatLabel", "appearance", "subscriptSizing", "hintLabel"], exportAs: ["matFormField"] }, { kind: "directive", type: MatInput, selector: "input[matInput], textarea[matInput], select[matNativeControl], input[matNativeControl], textarea[matNativeControl]", inputs: ["disabled", "id", "placeholder", "name", "required", "type", "errorStateMatcher", "aria-describedby", "value", "readonly", "disabledInteractive"], exportAs: ["matInput"] }, { kind: "directive", type: NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "component", type: MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "directive", type: MatLabel, selector: "mat-label" }, { kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: MatError, selector: "mat-error, [matError]", inputs: ["id"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }] });
172
+ }
173
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: RegistrationComponent, decorators: [{
174
+ type: Component,
175
+ args: [{ selector: 'pp-registration', imports: [ReactiveFormsModule, MatProgressBar, MatFormField, MatInput, NgIf, MatIconButton, MatIcon, MatLabel, MatButton, RouterLink, MatError, TranslocoDirective], providers: [provideTranslocoScope('auth')], template: "<div class=\"registration-container\">\n <ng-container *transloco=\"let t;\">\n <h1>{{t('auth.registration-form.title')}}</h1>\n\n <form [formGroup]=\"registerForm\" (ngSubmit)=\"onSubmit()\" aria-label=\"Registration Form\">\n <mat-progress-bar *ngIf=\"isLoading()\" mode=\"indeterminate\"></mat-progress-bar>\n\n <mat-form-field appearance=\"outline\">\n <mat-label>{{t('auth.registration-form.email_label')}}</mat-label>\n <input matInput type=\"email\" formControlName=\"email\" [placeholder]=\"t('auth.registration-form.email_placeholder')\">\n <mat-error *ngIf=\"registerForm.get('email')?.errors?.['required']\">{{t('auth.registration-form.email_err_required')}}</mat-error>\n <mat-error *ngIf=\"registerForm.get('email')?.errors?.['email']\">{{t('auth.registration-form.email_err_invalid')}}</mat-error>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\">\n <mat-label>{{t('auth.registration-form.password_label')}}</mat-label>\n <input matInput [type]=\"hidePassword ? 'password' : 'text'\" formControlName=\"password\" [placeholder]=\"t('auth.registration-form.password_placeholder')\">\n <button mat-icon-button type=\"button\" matSuffix (click)=\"hidePassword = !hidePassword\">\n <mat-icon>{{hidePassword ? 'visibility_off' : 'visibility'}}</mat-icon>\n </button>\n <mat-error *ngIf=\"registerForm.get('password')?.errors?.['required']\">{{t('auth.registration-form.password_err_required')}}</mat-error>\n <mat-error *ngIf=\"registerForm.get('password')?.errors?.['minlength']\">{{t('auth.registration-form.password_err_min_length')}}</mat-error>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\">\n <mat-label>{{t('auth.registration-form.password_confirm_label')}}</mat-label>\n <input matInput [type]=\"hideConfirmPassword ? 'password' : 'text'\" formControlName=\"confirmPassword\" [placeholder]=\"t('auth.registration-form.password_confirm_placeholder')\">\n <button mat-icon-button type=\"button\" matSuffix (click)=\"hideConfirmPassword = !hideConfirmPassword\">\n <mat-icon>{{hideConfirmPassword ? 'visibility_off' : 'visibility'}}</mat-icon>\n </button>\n <mat-error *ngIf=\"registerForm.errors?.['passwordMismatch']\">{{t('auth.registration-form.password_confirm_err_mismatch')}}</mat-error>\n </mat-form-field>\n\n <div class=\"form-actions\">\n <button mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"registerForm.invalid || isLoading()\">{{t('auth.registration-form.create_button')}}</button>\n <button mat-button type=\"button\" routerLink=\"/auth/login\" [disabled]=\"isLoading()\">{{t('auth.registration-form.sign_in_button')}}</button>\n </div>\n\n <mat-error *ngIf=\"errorMessage() !== ''\" class=\"server-error\">{{ errorMessage() }}</mat-error>\n </form>\n </ng-container>\n</div>\n", styles: [".registration-container{max-width:400px;margin:2rem auto;padding:2rem}form{display:flex;flex-direction:column;gap:1rem}.form-actions{display:flex;flex-direction:column;gap:.5rem;margin-top:1rem}.server-error{margin-top:1rem;text-align:center}h1{text-align:center;margin-bottom:2rem}\n"] }]
176
+ }], ctorParameters: () => [{ type: i1.MatSnackBar }] });
177
+
178
+ class AuthService {
179
+ auth = inject(Auth);
180
+ user = toSignal(authState(this.auth), { initialValue: null });
181
+ isAuthenticated = computed(() => !!this.user());
182
+ async signOut() {
183
+ return this.auth.signOut();
184
+ }
185
+ getCurrentUser() {
186
+ return this.auth.currentUser;
187
+ }
188
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: AuthService, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
189
+ static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: AuthService, providedIn: 'root' });
190
+ }
191
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: AuthService, decorators: [{
192
+ type: Injectable,
193
+ args: [{
194
+ providedIn: 'root',
195
+ }]
196
+ }] });
197
+
198
+ class LogoutComponent {
199
+ authService = inject(AuthService);
200
+ navigateBackService = inject(NavigateBackService);
201
+ isLoading = signal(false);
202
+ onCancel() {
203
+ this.navigateBackService.goBack();
204
+ }
205
+ async onLogout() {
206
+ try {
207
+ this.isLoading.set(true);
208
+ await this.authService.signOut();
209
+ this.navigateBackService.goBack();
210
+ }
211
+ catch (error) {
212
+ console.error('Error during logout:', error);
213
+ }
214
+ finally {
215
+ this.isLoading.set(false);
216
+ }
217
+ }
218
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: LogoutComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
219
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "19.2.11", type: LogoutComponent, isStandalone: true, selector: "pp-logout", providers: [provideTranslocoScope('auth')], ngImport: i0, template: `
220
+ <div class="logout-dialog">
221
+ <ng-container *transloco="let t">
222
+ <h2 mat-dialog-title>{{ t('auth.logout-dialog.title') }}</h2>
223
+ <mat-dialog-content>{{ t('auth.logout-dialog.content') }}</mat-dialog-content>
224
+ <mat-dialog-actions align="end">
225
+ <button mat-button (click)="onCancel()">{{ t('auth.logout-dialog.cancel_button') }}</button>
226
+ <button mat-raised-button color="primary" (click)="onLogout()" [disabled]="isLoading()">{{ t('auth.logout-dialog.logout_button') }}</button>
227
+ </mat-dialog-actions>
228
+ </ng-container>
229
+ </div>
230
+ `, isInline: true, styles: [".logout-dialog{padding:1rem}mat-dialog-actions{gap:.5rem}mat-dialog-content{margin:1rem 0}\n"], dependencies: [{ kind: "directive", type: MatDialogTitle, selector: "[mat-dialog-title], [matDialogTitle]", inputs: ["id"], exportAs: ["matDialogTitle"] }, { kind: "directive", type: MatDialogContent, selector: "[mat-dialog-content], mat-dialog-content, [matDialogContent]" }, { kind: "directive", type: MatDialogActions, selector: "[mat-dialog-actions], mat-dialog-actions, [matDialogActions]", inputs: ["align"] }, { kind: "component", type: MatButton, selector: " button[mat-button], button[mat-raised-button], button[mat-flat-button], button[mat-stroked-button] ", exportAs: ["matButton"] }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }] });
231
+ }
232
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: LogoutComponent, decorators: [{
233
+ type: Component,
234
+ args: [{ selector: 'pp-logout', template: `
235
+ <div class="logout-dialog">
236
+ <ng-container *transloco="let t">
237
+ <h2 mat-dialog-title>{{ t('auth.logout-dialog.title') }}</h2>
238
+ <mat-dialog-content>{{ t('auth.logout-dialog.content') }}</mat-dialog-content>
239
+ <mat-dialog-actions align="end">
240
+ <button mat-button (click)="onCancel()">{{ t('auth.logout-dialog.cancel_button') }}</button>
241
+ <button mat-raised-button color="primary" (click)="onLogout()" [disabled]="isLoading()">{{ t('auth.logout-dialog.logout_button') }}</button>
242
+ </mat-dialog-actions>
243
+ </ng-container>
244
+ </div>
245
+ `, imports: [MatDialogTitle, MatDialogContent, MatDialogActions, MatButton, TranslocoDirective], providers: [provideTranslocoScope('auth')], styles: [".logout-dialog{padding:1rem}mat-dialog-actions{gap:.5rem}mat-dialog-content{margin:1rem 0}\n"] }]
246
+ }] });
247
+
248
+ const loader = ['de', 'en', 'es', 'fr', 'hu'].reduce((acc, lang) => {
249
+ acc[lang] = () => import(`./assets/i18n/auth/${lang}.json`);
250
+ return acc;
251
+ }, {});
252
+ const authRoutes = [
253
+ { path: '', redirectTo: 'login', pathMatch: 'full' },
254
+ { path: 'login', component: LoginComponent, title: 'login', data: { icon: 'login', authToggle: true }, providers: [provideTranslocoScope({ scope: 'auth', loader })] },
255
+ { path: 'logout', component: LogoutComponent, title: 'logout', data: { icon: 'logout', authToggle: false } },
256
+ { path: 'register', component: RegistrationComponent, title: 'register', data: { icon: 'person_add', authToggle: true } },
257
+ { path: 'my-profile', component: MyProfileComponent, title: 'my_profile', data: { icon: 'person', authToggle: false } },
258
+ ];
259
+
260
+ class AuthButtonComponent {
261
+ authService = inject(AuthService);
262
+ isAuthenticated = computed(() => this.authService.isAuthenticated());
263
+ routes = authRoutes.filter((item) => item.title !== null && item.title !== undefined);
264
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: AuthButtonComponent, deps: [], target: i0.ɵɵFactoryTarget.Component });
265
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "19.2.11", type: AuthButtonComponent, isStandalone: true, selector: "pp-auth-button", providers: [provideTranslocoScope('auth')], ngImport: i0, template: `
266
+ <div class="auth-button">
267
+ <ng-container *transloco="let t">
268
+ <button mat-icon-button [matMenuTriggerFor]="menu" aria-label="Auth Button">
269
+ <mat-icon>person</mat-icon>
270
+ </button>
271
+ <mat-menu #menu="matMenu">
272
+ @for (item of routes; track item) {
273
+ <ng-container *ngIf="(isAuthenticated() && !item.data?.['authToggle']) || (!isAuthenticated() && item.data?.['authToggle'])">
274
+ <button mat-menu-item [routerLink]="'auth/' + item.path">
275
+ <mat-icon>{{ item.data?.['icon'] }}</mat-icon>
276
+ <span>&nbsp;{{ t('auth.button.' + item.title | substring: 0) }}</span>
277
+ </button>
278
+ </ng-container>
279
+ }
280
+ </mat-menu>
281
+ </ng-container>
282
+ </div>
283
+ `, isInline: true, dependencies: [{ kind: "ngmodule", type: CommonModule }, { kind: "directive", type: i1$1.NgIf, selector: "[ngIf]", inputs: ["ngIf", "ngIfThen", "ngIfElse"] }, { kind: "ngmodule", type: MatIconModule }, { kind: "component", type: i2$1.MatIcon, selector: "mat-icon", inputs: ["color", "inline", "svgIcon", "fontSet", "fontIcon"], exportAs: ["matIcon"] }, { kind: "ngmodule", type: MatButtonModule }, { kind: "component", type: i3.MatIconButton, selector: "button[mat-icon-button]", exportAs: ["matButton"] }, { kind: "component", type: MatMenu, selector: "mat-menu", inputs: ["backdropClass", "aria-label", "aria-labelledby", "aria-describedby", "xPosition", "yPosition", "overlapTrigger", "hasBackdrop", "class", "classList"], outputs: ["closed", "close"], exportAs: ["matMenu"] }, { kind: "component", type: MatMenuItem, selector: "[mat-menu-item]", inputs: ["role", "disabled", "disableRipple"], exportAs: ["matMenuItem"] }, { kind: "directive", type: RouterLink, selector: "[routerLink]", inputs: ["target", "queryParams", "fragment", "queryParamsHandling", "state", "info", "relativeTo", "preserveFragment", "skipLocationChange", "replaceUrl", "routerLink"] }, { kind: "directive", type: MatMenuTrigger, selector: "[mat-menu-trigger-for], [matMenuTriggerFor]", inputs: ["mat-menu-trigger-for", "matMenuTriggerFor", "matMenuTriggerData", "matMenuTriggerRestoreFocus"], outputs: ["menuOpened", "onMenuOpen", "menuClosed", "onMenuClose"], exportAs: ["matMenuTrigger"] }, { kind: "pipe", type: SubstringPipe, name: "substring" }, { kind: "directive", type: TranslocoDirective, selector: "[transloco]", inputs: ["transloco", "translocoParams", "translocoScope", "translocoRead", "translocoPrefix", "translocoLang", "translocoLoadingTpl"] }] });
284
+ }
285
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "19.2.11", ngImport: i0, type: AuthButtonComponent, decorators: [{
286
+ type: Component,
287
+ args: [{ selector: 'pp-auth-button', template: `
288
+ <div class="auth-button">
289
+ <ng-container *transloco="let t">
290
+ <button mat-icon-button [matMenuTriggerFor]="menu" aria-label="Auth Button">
291
+ <mat-icon>person</mat-icon>
292
+ </button>
293
+ <mat-menu #menu="matMenu">
294
+ @for (item of routes; track item) {
295
+ <ng-container *ngIf="(isAuthenticated() && !item.data?.['authToggle']) || (!isAuthenticated() && item.data?.['authToggle'])">
296
+ <button mat-menu-item [routerLink]="'auth/' + item.path">
297
+ <mat-icon>{{ item.data?.['icon'] }}</mat-icon>
298
+ <span>&nbsp;{{ t('auth.button.' + item.title | substring: 0) }}</span>
299
+ </button>
300
+ </ng-container>
301
+ }
302
+ </mat-menu>
303
+ </ng-container>
304
+ </div>
305
+ `, imports: [CommonModule, MatIconModule, MatButtonModule, MatMenu, MatMenuItem, RouterLink, MatMenuTrigger, SubstringPipe, TranslocoDirective], providers: [provideTranslocoScope('auth')] }]
306
+ }] });
307
+
308
+ /**
309
+ * Generated bundle index. Do not edit.
310
+ */
311
+
312
+ export { AuthButtonComponent, authRoutes };
313
+ //# sourceMappingURL=processpuzzle-auth.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"processpuzzle-auth.mjs","sources":["../../../../libs/auth/src/lib/login/login.component.ts","../../../../libs/auth/src/lib/login/login.component.html","../../../../libs/auth/src/lib/my-profile/my-profile.component.ts","../../../../libs/auth/src/lib/my-profile/my-profile.component.html","../../../../libs/auth/src/lib/registration/registration.component.ts","../../../../libs/auth/src/lib/registration/registration.component.html","../../../../libs/auth/src/lib/domain/auth.service.ts","../../../../libs/auth/src/lib/logout/logout.component.ts","../../../../libs/auth/src/lib/auth.routes.ts","../../../../libs/auth/src/lib/auth-button/auth-button.component.ts","../../../../libs/auth/src/processpuzzle-auth.ts"],"sourcesContent":["import { Component, inject, signal } from '@angular/core';\nimport { Auth, GoogleAuthProvider, signInWithEmailAndPassword, signInWithPopup } from '@angular/fire/auth';\nimport { Router, RouterLink } from '@angular/router';\nimport { FormBuilder, FormGroup, ReactiveFormsModule, Validators } from '@angular/forms';\nimport { MatError, MatFormField, MatSuffix } from '@angular/material/form-field';\nimport { MatInput, MatLabel } from '@angular/material/input';\nimport { MatButton, MatIconButton } from '@angular/material/button';\nimport { MatIcon } from '@angular/material/icon';\nimport { MatDivider } from '@angular/material/divider';\nimport { NgIf } from '@angular/common';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { FirebaseError } from 'firebase-admin/lib/utils/error';\nimport { provideTranslocoScope, TranslocoDirective } from '@jsverse/transloco';\n\n@Component({\n selector: 'pp-login',\n templateUrl: 'login.component.html',\n styleUrls: ['login.component.css'],\n imports: [MatButton, MatDivider, MatError, MatFormField, MatIcon, MatIconButton, MatInput, MatLabel, MatSuffix, ReactiveFormsModule, NgIf, RouterLink, TranslocoDirective],\n providers: [provideTranslocoScope('auth')],\n})\nexport class LoginComponent {\n private readonly auth: Auth = inject(Auth);\n private readonly fb = inject(FormBuilder);\n private readonly router = inject(Router);\n\n loginForm: FormGroup;\n isLoading = signal(false);\n errorMessage = signal('');\n hidePassword = true;\n\n constructor(private readonly snackBar: MatSnackBar) {\n this.loginForm = this.fb.group({\n email: ['', [Validators.required, Validators.email]],\n password: ['', Validators.required],\n });\n }\n\n async onSubmit() {\n if (this.loginForm.invalid) return;\n\n this.isLoading.set(true);\n\n try {\n const { email, password } = this.loginForm.value;\n await signInWithEmailAndPassword(this.auth, email, password);\n await this.router.navigate(['/']);\n } catch (error: unknown) {\n this.snackBar.open(this.getErrorMessage((error as FirebaseError).code), 'Close', { duration: 5000, panelClass: ['error-snackbar'] });\n } finally {\n this.isLoading.set(false);\n this.errorMessage.set('');\n }\n }\n\n async signInWithGoogle() {\n this.isLoading.set(true);\n\n try {\n const provider = new GoogleAuthProvider();\n await signInWithPopup(this.auth, provider);\n await this.router.navigate(['/']); // Navigate to home page after successful login\n } catch (error: unknown) {\n this.snackBar.open(this.getErrorMessage((error as FirebaseError).code), 'Close', { duration: 5000, panelClass: ['error-snackbar'] });\n } finally {\n this.isLoading.set(false);\n this.errorMessage.set('');\n }\n }\n\n private getErrorMessage(errorCode: string): string {\n switch (errorCode) {\n case 'auth/invalid-email':\n return 'Invalid email address';\n case 'auth/user-disabled':\n return 'This account has been disabled';\n case 'auth/user-not-found':\n return 'No account found with this email';\n case 'auth/wrong-password':\n return 'Invalid password';\n case 'auth/popup-closed-by-user':\n return 'Sign-in popup was closed before completion';\n default:\n return 'An error occurred during sign in';\n }\n }\n}\n","<div class=\"login-container\">\n <ng-container *transloco=\"let t;\">\n <h2>{{t('auth.login-form.title')}}</h2>\n\n <form [formGroup]=\"loginForm\" (ngSubmit)=\"onSubmit()\" aria-label=\"Login Form\">\n <mat-form-field appearance=\"outline\">\n <mat-label>{{t('auth.login-form.email_label')}}</mat-label>\n <input matInput type=\"email\" formControlName=\"email\" placeholder=\"Enter your email\">\n <mat-error *ngIf=\"loginForm.get('email')?.hasError('required')\">{{t('auth.login-form.email_err_required')}}</mat-error>\n <mat-error *ngIf=\"loginForm.get('email')?.hasError('email')\">{{t('auth.login-form.email_err_invalid')}}</mat-error>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\">\n <mat-label>{{t('auth.login-form.password_label')}}</mat-label>\n <input matInput [type]=\"hidePassword ? 'password' : 'text'\" formControlName=\"password\">\n <button mat-icon-button matSuffix type=\"button\" (click)=\"hidePassword = !hidePassword\" aria-label=\"Toggle Password Visibility\">\n <mat-icon>{{hidePassword ? 'visibility_off' : 'visibility'}}</mat-icon>\n </button>\n <mat-error *ngIf=\"loginForm.get('password')?.hasError('required')\">{{t('auth.login-form.password_err_required')}}</mat-error>\n </mat-form-field>\n\n <div class=\"actions\">\n <button mat-raised-button color=\"secondary\" routerLink=\"/auth/register\">{{t('auth.login-form.create_account_button')}}</button>\n <button mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"loginForm.invalid || isLoading()\">{{ isLoading() ? t('auth.login-form.signing_in_button') : t('auth.login-form.sign_in_button') }}</button>\n </div>\n </form>\n\n <mat-divider class=\"divider\">OR</mat-divider>\n\n <button mat-stroked-button (click)=\"signInWithGoogle()\" [disabled]=\"isLoading()\">\n <svg xmlns=\"http://www.w3.org/2000/svg\" width=\"18\" height=\"18\" viewBox=\"0 0 48 48\">\n <path fill=\"#FFC107\" d=\"M43.611,20.083H42V20H24v8h11.303c-1.649,4.657-6.08,8-11.303,8c-6.627,0-12-5.373-12-12\ts5.373-12,12-12c3.059,0,5.842,1.154,7.961,3.039l5.657-5.657C34.046,6.053,29.268,4,24,4C12.955,4,4,12.955,4,24s8.955,20,20,20\ts20-8.955,20-20C44,22.659,43.862,21.35,43.611,20.083z\"/>\n <path fill=\"#FF3D00\" d=\"M6.306,14.691l6.571,4.819C14.655,15.108,18.961,12,24,12c3.059,0,5.842,1.154,7.961,3.039\tl5.657-5.657C34.046,6.053,29.268,4,24,4C16.318,4,9.656,8.337,6.306,14.691z\"/>\n <path fill=\"#4CAF50\" d=\"M24,44c5.166,0,9.86-1.977,13.409-5.192l-6.19-5.238C29.211,35.091,26.715,36,24,36\tc-5.202,0-9.619-3.317-11.283-7.946l-6.522,5.025C9.505,39.556,16.227,44,24,44z\"/>\n <path fill=\"#1976D2\" d=\"M43.611,20.083H42V20H24v8h11.303c-0.792,2.237-2.231,4.166-4.087,5.571\tc0.001-0.001,0.002-0.001,0.003-0.002l6.19,5.238C36.971,39.205,44,34,44,24C44,22.659,43.862,21.35,43.611,20.083z\"/>\n </svg>\n {{t('auth.login-form.google_button')}}\n </button>\n <div class=\"error-message\" *ngIf=\"errorMessage\">{{ errorMessage() }}</div>\n </ng-container>\n</div>\n","import { Component } from '@angular/core';\nimport { provideTranslocoScope } from '@jsverse/transloco';\n\n@Component({\n selector: 'pp-my-profile',\n templateUrl: 'my-profile.component.html',\n styles: ``,\n imports: [],\n providers: [provideTranslocoScope('auth')],\n})\nexport class MyProfileComponent {}\n","<h1>My profile</h1>\n","import { Component, inject, signal } from '@angular/core';\nimport { AbstractControl, FormGroup, NonNullableFormBuilder, ReactiveFormsModule, ValidationErrors, ValidatorFn, Validators } from '@angular/forms';\nimport { Auth, createUserWithEmailAndPassword } from '@angular/fire/auth';\nimport { RouterLink } from '@angular/router';\nimport { MatProgressBar } from '@angular/material/progress-bar';\nimport { MatError, MatFormField } from '@angular/material/form-field';\nimport { MatInput, MatLabel } from '@angular/material/input';\nimport { NgIf } from '@angular/common';\nimport { MatButton, MatIconButton } from '@angular/material/button';\nimport { MatIcon } from '@angular/material/icon';\nimport { NavigateBackService } from '@processpuzzle/widgets';\nimport { MatSnackBar } from '@angular/material/snack-bar';\nimport { FirebaseError } from 'firebase-admin/lib/utils/error';\nimport { provideTranslocoScope, TranslocoDirective } from '@jsverse/transloco';\n\n@Component({\n selector: 'pp-registration',\n templateUrl: 'registration.component.html',\n styleUrls: ['registration.component.css'],\n imports: [ReactiveFormsModule, MatProgressBar, MatFormField, MatInput, NgIf, MatIconButton, MatIcon, MatLabel, MatButton, RouterLink, MatError, TranslocoDirective],\n providers: [provideTranslocoScope('auth')],\n})\nexport class RegistrationComponent {\n private readonly auth = inject(Auth);\n private readonly fb = inject(NonNullableFormBuilder);\n private readonly navigateBack = inject(NavigateBackService);\n\n protected registerForm: FormGroup;\n protected isLoading = signal<boolean>(false);\n protected errorMessage = signal<string>('');\n protected hidePassword = true;\n protected hideConfirmPassword = true;\n\n constructor(private readonly snackBar: MatSnackBar) {\n this.registerForm = this.fb.group(\n {\n email: ['', [Validators.required, Validators.email]],\n password: ['', [Validators.required, Validators.minLength(6)]],\n confirmPassword: ['', Validators.required],\n },\n {\n validators: [this.passwordMatchValidator],\n },\n );\n }\n\n private passwordMatchValidator(): ValidatorFn {\n return (form: AbstractControl): ValidationErrors | null => {\n const password = form.get('password')?.value;\n const confirmPassword = form.get('confirmPassword')?.value;\n\n if (password !== confirmPassword) {\n return { passwordMismatch: true };\n }\n return null;\n };\n }\n\n async onSubmit(): Promise<void> {\n if (this.registerForm.invalid) return;\n\n this.isLoading.set(true);\n\n try {\n const { email, password } = this.registerForm.value;\n await createUserWithEmailAndPassword(this.auth, email, password);\n } catch (error: unknown) {\n this.snackBar.open(this.getErrorMessage((error as FirebaseError).code), 'Close', {\n duration: 5000,\n panelClass: ['error-snackbar'],\n });\n } finally {\n this.isLoading.set(false);\n this.errorMessage.set('');\n this.navigateBack.goBack();\n }\n }\n\n private getErrorMessage(errorCode: string): string {\n switch (errorCode) {\n case 'auth/email-already-in-use':\n return 'This email address is already registered';\n case 'auth/invalid-email':\n return 'Please enter a valid email address';\n case 'auth/operation-not-allowed':\n return 'Email/password registration is not enabled';\n case 'auth/weak-password':\n return 'Please choose a stronger password';\n default:\n return 'An error occurred during registration. Please try again.';\n }\n }\n}\n","<div class=\"registration-container\">\n <ng-container *transloco=\"let t;\">\n <h1>{{t('auth.registration-form.title')}}</h1>\n\n <form [formGroup]=\"registerForm\" (ngSubmit)=\"onSubmit()\" aria-label=\"Registration Form\">\n <mat-progress-bar *ngIf=\"isLoading()\" mode=\"indeterminate\"></mat-progress-bar>\n\n <mat-form-field appearance=\"outline\">\n <mat-label>{{t('auth.registration-form.email_label')}}</mat-label>\n <input matInput type=\"email\" formControlName=\"email\" [placeholder]=\"t('auth.registration-form.email_placeholder')\">\n <mat-error *ngIf=\"registerForm.get('email')?.errors?.['required']\">{{t('auth.registration-form.email_err_required')}}</mat-error>\n <mat-error *ngIf=\"registerForm.get('email')?.errors?.['email']\">{{t('auth.registration-form.email_err_invalid')}}</mat-error>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\">\n <mat-label>{{t('auth.registration-form.password_label')}}</mat-label>\n <input matInput [type]=\"hidePassword ? 'password' : 'text'\" formControlName=\"password\" [placeholder]=\"t('auth.registration-form.password_placeholder')\">\n <button mat-icon-button type=\"button\" matSuffix (click)=\"hidePassword = !hidePassword\">\n <mat-icon>{{hidePassword ? 'visibility_off' : 'visibility'}}</mat-icon>\n </button>\n <mat-error *ngIf=\"registerForm.get('password')?.errors?.['required']\">{{t('auth.registration-form.password_err_required')}}</mat-error>\n <mat-error *ngIf=\"registerForm.get('password')?.errors?.['minlength']\">{{t('auth.registration-form.password_err_min_length')}}</mat-error>\n </mat-form-field>\n\n <mat-form-field appearance=\"outline\">\n <mat-label>{{t('auth.registration-form.password_confirm_label')}}</mat-label>\n <input matInput [type]=\"hideConfirmPassword ? 'password' : 'text'\" formControlName=\"confirmPassword\" [placeholder]=\"t('auth.registration-form.password_confirm_placeholder')\">\n <button mat-icon-button type=\"button\" matSuffix (click)=\"hideConfirmPassword = !hideConfirmPassword\">\n <mat-icon>{{hideConfirmPassword ? 'visibility_off' : 'visibility'}}</mat-icon>\n </button>\n <mat-error *ngIf=\"registerForm.errors?.['passwordMismatch']\">{{t('auth.registration-form.password_confirm_err_mismatch')}}</mat-error>\n </mat-form-field>\n\n <div class=\"form-actions\">\n <button mat-raised-button color=\"primary\" type=\"submit\" [disabled]=\"registerForm.invalid || isLoading()\">{{t('auth.registration-form.create_button')}}</button>\n <button mat-button type=\"button\" routerLink=\"/auth/login\" [disabled]=\"isLoading()\">{{t('auth.registration-form.sign_in_button')}}</button>\n </div>\n\n <mat-error *ngIf=\"errorMessage() !== ''\" class=\"server-error\">{{ errorMessage() }}</mat-error>\n </form>\n </ng-container>\n</div>\n","import { computed, inject, Injectable, Signal } from '@angular/core';\nimport { Auth, authState, User } from '@angular/fire/auth';\nimport { toSignal } from '@angular/core/rxjs-interop';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class AuthService {\n private readonly auth: Auth = inject(Auth);\n readonly user = toSignal<User | null>(authState(this.auth), { initialValue: null });\n isAuthenticated: Signal<boolean> = computed(() => !!this.user());\n\n async signOut(): Promise<void> {\n return this.auth.signOut();\n }\n\n getCurrentUser(): User | null {\n return this.auth.currentUser;\n }\n}\n","import { Component, inject, signal } from '@angular/core';\nimport { MatDialogActions, MatDialogContent, MatDialogTitle } from '@angular/material/dialog';\nimport { MatButton } from '@angular/material/button';\nimport { AuthService } from '../domain/auth.service';\nimport { NavigateBackService } from '@processpuzzle/widgets';\nimport { provideTranslocoScope, TranslocoDirective } from '@jsverse/transloco';\n\n@Component({\n selector: 'pp-logout',\n template: `\n <div class=\"logout-dialog\">\n <ng-container *transloco=\"let t\">\n <h2 mat-dialog-title>{{ t('auth.logout-dialog.title') }}</h2>\n <mat-dialog-content>{{ t('auth.logout-dialog.content') }}</mat-dialog-content>\n <mat-dialog-actions align=\"end\">\n <button mat-button (click)=\"onCancel()\">{{ t('auth.logout-dialog.cancel_button') }}</button>\n <button mat-raised-button color=\"primary\" (click)=\"onLogout()\" [disabled]=\"isLoading()\">{{ t('auth.logout-dialog.logout_button') }}</button>\n </mat-dialog-actions>\n </ng-container>\n </div>\n `,\n styles: [\n `\n .logout-dialog {\n padding: 1rem;\n }\n\n mat-dialog-actions {\n gap: 0.5rem;\n }\n\n mat-dialog-content {\n margin: 1rem 0;\n }\n `,\n ],\n imports: [MatDialogTitle, MatDialogContent, MatDialogActions, MatButton, TranslocoDirective],\n providers: [provideTranslocoScope('auth')],\n})\nexport class LogoutComponent {\n private readonly authService = inject(AuthService);\n private readonly navigateBackService = inject(NavigateBackService);\n protected isLoading = signal(false);\n\n onCancel() {\n this.navigateBackService.goBack();\n }\n\n async onLogout(): Promise<void> {\n try {\n this.isLoading.set(true);\n await this.authService.signOut();\n this.navigateBackService.goBack();\n } catch (error) {\n console.error('Error during logout:', error);\n } finally {\n this.isLoading.set(false);\n }\n }\n}\n","import { Routes } from '@angular/router';\nimport { LoginComponent } from './login/login.component';\nimport { MyProfileComponent } from './my-profile/my-profile.component';\nimport { RegistrationComponent } from './registration/registration.component';\nimport { LogoutComponent } from './logout/logout.component';\nimport { provideTranslocoScope } from '@jsverse/transloco';\n\nconst loader = ['de', 'en', 'es', 'fr', 'hu'].reduce((acc: any, lang) => {\n acc[lang] = () => import(`./assets/i18n/auth/${lang}.json`);\n return acc;\n}, {});\n\nexport const authRoutes: Routes = [\n { path: '', redirectTo: 'login', pathMatch: 'full' },\n { path: 'login', component: LoginComponent, title: 'login', data: { icon: 'login', authToggle: true }, providers: [provideTranslocoScope({ scope: 'auth', loader })] },\n { path: 'logout', component: LogoutComponent, title: 'logout', data: { icon: 'logout', authToggle: false } },\n { path: 'register', component: RegistrationComponent, title: 'register', data: { icon: 'person_add', authToggle: true } },\n { path: 'my-profile', component: MyProfileComponent, title: 'my_profile', data: { icon: 'person', authToggle: false } },\n];\n","import { Component, computed, inject } from '@angular/core';\nimport { CommonModule } from '@angular/common';\nimport { MatIconModule } from '@angular/material/icon';\nimport { MatButtonModule } from '@angular/material/button';\nimport { MatMenu, MatMenuItem, MatMenuTrigger } from '@angular/material/menu';\nimport { RouterLink } from '@angular/router';\nimport { AuthService } from '../domain/auth.service';\nimport { authRoutes } from '../auth.routes';\nimport { SubstringPipe } from '@processpuzzle/util';\nimport { provideTranslocoScope, TranslocoDirective } from '@jsverse/transloco';\n\n@Component({\n selector: 'pp-auth-button',\n template: `\n <div class=\"auth-button\">\n <ng-container *transloco=\"let t\">\n <button mat-icon-button [matMenuTriggerFor]=\"menu\" aria-label=\"Auth Button\">\n <mat-icon>person</mat-icon>\n </button>\n <mat-menu #menu=\"matMenu\">\n @for (item of routes; track item) {\n <ng-container *ngIf=\"(isAuthenticated() && !item.data?.['authToggle']) || (!isAuthenticated() && item.data?.['authToggle'])\">\n <button mat-menu-item [routerLink]=\"'auth/' + item.path\">\n <mat-icon>{{ item.data?.['icon'] }}</mat-icon>\n <span>&nbsp;{{ t('auth.button.' + item.title | substring: 0) }}</span>\n </button>\n </ng-container>\n }\n </mat-menu>\n </ng-container>\n </div>\n `,\n imports: [CommonModule, MatIconModule, MatButtonModule, MatMenu, MatMenuItem, RouterLink, MatMenuTrigger, SubstringPipe, TranslocoDirective],\n styles: [],\n providers: [provideTranslocoScope('auth')],\n})\nexport class AuthButtonComponent {\n private readonly authService = inject(AuthService);\n isAuthenticated = computed(() => this.authService.isAuthenticated());\n readonly routes = authRoutes.filter((item) => item.title !== null && item.title !== undefined);\n\n // region event handling methods\n // endregion\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1","i2"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;MAqBa,cAAc,CAAA;AAUI,IAAA,QAAA;AATZ,IAAA,IAAI,GAAS,MAAM,CAAC,IAAI,CAAC;AACzB,IAAA,EAAE,GAAG,MAAM,CAAC,WAAW,CAAC;AACxB,IAAA,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC;AAExC,IAAA,SAAS;AACT,IAAA,SAAS,GAAG,MAAM,CAAC,KAAK,CAAC;AACzB,IAAA,YAAY,GAAG,MAAM,CAAC,EAAE,CAAC;IACzB,YAAY,GAAG,IAAI;AAEnB,IAAA,WAAA,CAA6B,QAAqB,EAAA;QAArB,IAAQ,CAAA,QAAA,GAAR,QAAQ;QACnC,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC;AAC7B,YAAA,KAAK,EAAE,CAAC,EAAE,EAAE,CAAC,UAAU,CAAC,QAAQ,EAAE,UAAU,CAAC,KAAK,CAAC,CAAC;AACpD,YAAA,QAAQ,EAAE,CAAC,EAAE,EAAE,UAAU,CAAC,QAA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EAAA,aAAa,kDAAE,kBAAkB,EAAA,QAAA,EAAA,aAAA,EAAA,MAAA,EAAA,CAAA,WAAA,EAAA,iBAAA,EAAA,gBAAA,EAAA,eAAA,EAAA,iBAAA,EAAA,eAAA,EAAA,qBAAA,CAAA,EAAA,CAAA,EAAA,CAAA;;4FAIhI,mBAAmB,EAAA,UAAA,EAAA,CAAA;kBAzB/B,SAAS;AACE,YAAA,IAAA,EAAA,CAAA,EAAA,QAAA,EAAA,gBAAgB,EAChB,QAAA,EAAA;;;;;;;;;;;;;;;;;;GAkBT,EACQ,OAAA,EAAA,CAAC,YAAY,EAAE,aAAa,EAAE,eAAe,EAAE,OAAO,EAAE,WAAW,EAAE,UAAU,EAAE,cAAc,EAAE,aAAa,EAAE,kBAAkB,CAAC,EAEjI,SAAA,EAAA,CAAC,qBAAqB,CAAC,MAAM,CAAC,CAAC,EAAA;;;AClC5C;;AAEG;;;;"}
package/index.d.ts ADDED
@@ -0,0 +1,5 @@
1
+ /**
2
+ * Generated bundle index. Do not edit.
3
+ */
4
+ /// <amd-module name="@processpuzzle/auth" />
5
+ export * from './public-api';
@@ -0,0 +1,8 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class AuthButtonComponent {
3
+ private readonly authService;
4
+ isAuthenticated: import("@angular/core").Signal<boolean>;
5
+ readonly routes: import("@angular/router").Route[];
6
+ static ɵfac: i0.ɵɵFactoryDeclaration<AuthButtonComponent, never>;
7
+ static ɵcmp: i0.ɵɵComponentDeclaration<AuthButtonComponent, "pp-auth-button", never, {}, {}, never, never, true, never>;
8
+ }
@@ -0,0 +1,2 @@
1
+ import { Routes } from '@angular/router';
2
+ export declare const authRoutes: Routes;
@@ -0,0 +1,12 @@
1
+ import { Signal } from '@angular/core';
2
+ import { User } from '@angular/fire/auth';
3
+ import * as i0 from "@angular/core";
4
+ export declare class AuthService {
5
+ private readonly auth;
6
+ readonly user: Signal<User | null>;
7
+ isAuthenticated: Signal<boolean>;
8
+ signOut(): Promise<void>;
9
+ getCurrentUser(): User | null;
10
+ static ɵfac: i0.ɵɵFactoryDeclaration<AuthService, never>;
11
+ static ɵprov: i0.ɵɵInjectableDeclaration<AuthService>;
12
+ }
@@ -0,0 +1,19 @@
1
+ import { FormGroup } from '@angular/forms';
2
+ import { MatSnackBar } from '@angular/material/snack-bar';
3
+ import * as i0 from "@angular/core";
4
+ export declare class LoginComponent {
5
+ private readonly snackBar;
6
+ private readonly auth;
7
+ private readonly fb;
8
+ private readonly router;
9
+ loginForm: FormGroup;
10
+ isLoading: import("@angular/core").WritableSignal<boolean>;
11
+ errorMessage: import("@angular/core").WritableSignal<string>;
12
+ hidePassword: boolean;
13
+ constructor(snackBar: MatSnackBar);
14
+ onSubmit(): Promise<void>;
15
+ signInWithGoogle(): Promise<void>;
16
+ private getErrorMessage;
17
+ static ɵfac: i0.ɵɵFactoryDeclaration<LoginComponent, never>;
18
+ static ɵcmp: i0.ɵɵComponentDeclaration<LoginComponent, "pp-login", never, {}, {}, never, never, true, never>;
19
+ }
@@ -0,0 +1,10 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class LogoutComponent {
3
+ private readonly authService;
4
+ private readonly navigateBackService;
5
+ protected isLoading: import("@angular/core").WritableSignal<boolean>;
6
+ onCancel(): void;
7
+ onLogout(): Promise<void>;
8
+ static ɵfac: i0.ɵɵFactoryDeclaration<LogoutComponent, never>;
9
+ static ɵcmp: i0.ɵɵComponentDeclaration<LogoutComponent, "pp-logout", never, {}, {}, never, never, true, never>;
10
+ }
@@ -0,0 +1,5 @@
1
+ import * as i0 from "@angular/core";
2
+ export declare class MyProfileComponent {
3
+ static ɵfac: i0.ɵɵFactoryDeclaration<MyProfileComponent, never>;
4
+ static ɵcmp: i0.ɵɵComponentDeclaration<MyProfileComponent, "pp-my-profile", never, {}, {}, never, never, true, never>;
5
+ }
@@ -0,0 +1,20 @@
1
+ import { FormGroup } from '@angular/forms';
2
+ import { MatSnackBar } from '@angular/material/snack-bar';
3
+ import * as i0 from "@angular/core";
4
+ export declare class RegistrationComponent {
5
+ private readonly snackBar;
6
+ private readonly auth;
7
+ private readonly fb;
8
+ private readonly navigateBack;
9
+ protected registerForm: FormGroup;
10
+ protected isLoading: import("@angular/core").WritableSignal<boolean>;
11
+ protected errorMessage: import("@angular/core").WritableSignal<string>;
12
+ protected hidePassword: boolean;
13
+ protected hideConfirmPassword: boolean;
14
+ constructor(snackBar: MatSnackBar);
15
+ private passwordMatchValidator;
16
+ onSubmit(): Promise<void>;
17
+ private getErrorMessage;
18
+ static ɵfac: i0.ɵɵFactoryDeclaration<RegistrationComponent, never>;
19
+ static ɵcmp: i0.ɵɵComponentDeclaration<RegistrationComponent, "pp-registration", never, {}, {}, never, never, true, never>;
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@processpuzzle/auth",
3
- "version": "0.0.1",
3
+ "version": "0.0.3",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -12,10 +12,23 @@
12
12
  "homepage": "https://github.com/ZsZs/processpuzzle#readme",
13
13
  "peerDependencies": {
14
14
  "@angular/common": "^19.2.0",
15
- "@angular/core": "^19.2.0"
15
+ "@angular/core": "^19.2.0",
16
+ "@angular/forms": "^19.2.0",
17
+ "@angular/router": "^19.2.0",
18
+ "@angular/material": "^19.2.0",
19
+ "@angular/cdk": "^19.2.0",
20
+ "@angular/fire": "^19.1.0",
21
+ "@processpuzzle/util": "^0.0.1",
22
+ "firebase-admin": "^13.2.0",
23
+ "rxjs": "~7.8.0"
16
24
  },
25
+ "dependencies": {
26
+ "tslib": "^2.8.1"
27
+ },
28
+ "sideEffects": false,
29
+ "module": "fesm2022/processpuzzle-auth.mjs",
30
+ "typings": "index.d.ts",
17
31
  "exports": {
18
- "./i18n/*": "./i18n/pp-auth/*",
19
32
  "./package.json": {
20
33
  "default": "./package.json"
21
34
  },
@@ -23,15 +36,5 @@
23
36
  "types": "./index.d.ts",
24
37
  "default": "./fesm2022/processpuzzle-auth.mjs"
25
38
  }
26
- },
27
- "files": [
28
- "dist/libs/auth/",
29
- "i18n/"
30
- ],
31
- "sideEffects": false,
32
- "module": "fesm2022/processpuzzle-auth.mjs",
33
- "typings": "index.d.ts",
34
- "dependencies": {
35
- "tslib": "^2.3.0"
36
39
  }
37
40
  }
@@ -0,0 +1,2 @@
1
+ export * from './lib/auth.routes';
2
+ export { AuthButtonComponent } from './lib/auth-button/auth-button.component';