From 522ea848be02348d275e6bbde9b609c6d1dad60c Mon Sep 17 00:00:00 2001 From: _Bastler <_Bastler@bstly.de> Date: Wed, 17 Dec 2025 15:01:09 +0100 Subject: [PATCH] remove unused components --- src/app/app.module.ts | 2 - .../login-totp/login-totp.component.html | 27 ------- .../login-totp/login-totp.component.scss | 3 - .../pages/login-totp/login-totp.component.ts | 54 -------------- src/app/pages/login/login.component.html | 36 ---------- src/app/pages/login/login.component.scss | 3 - src/app/pages/login/login.component.ts | 71 ------------------- 7 files changed, 196 deletions(-) delete mode 100644 src/app/pages/login-totp/login-totp.component.html delete mode 100644 src/app/pages/login-totp/login-totp.component.scss delete mode 100644 src/app/pages/login-totp/login-totp.component.ts delete mode 100644 src/app/pages/login/login.component.html delete mode 100644 src/app/pages/login/login.component.scss delete mode 100644 src/app/pages/login/login.component.ts diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 44933ce..e745723 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -18,7 +18,6 @@ import { MainComponent } from './ui/main/main.component'; import { AccountComponent } from './pages/account/account.component'; import { ServicesComponent } from './pages/services/services.component'; import { AppComponent } from './app.component'; -import { LoginComponent } from './pages/login/login.component'; import { FormLoginComponent } from './pages/form-login/form-login.component'; import { FormLogin2FAComponent } from './pages/form-login-2fa/form-login-2fa.component'; import { TokensComponent } from './pages/tokens/tokens.component'; @@ -129,7 +128,6 @@ export class XhrInterceptor implements HttpInterceptor { MainComponent, AppComponent, AccountComponent, - LoginComponent, FormLoginComponent, FormLogin2FAComponent, FormLoginOidcComponent, diff --git a/src/app/pages/login-totp/login-totp.component.html b/src/app/pages/login-totp/login-totp.component.html deleted file mode 100644 index 27660db..0000000 --- a/src/app/pages/login-totp/login-totp.component.html +++ /dev/null @@ -1,27 +0,0 @@ -
- - -

{{'security.2fa.totp' | i18n}}

- @if (loginInvalid) { - - {{'security.2fa.totp.invalid' | i18n}} - - } - - {{'security.2fa.totp.code' | i18n}} - - - {{'security.2fa.totp.missing' | i18n}} - - - - {{'security.2fa.totp.keepSession' | i18n}} - -
- - {{'security.2fa.totp.login' | i18n}} - -
-
\ No newline at end of file diff --git a/src/app/pages/login-totp/login-totp.component.scss b/src/app/pages/login-totp/login-totp.component.scss deleted file mode 100644 index 9ee20ad..0000000 --- a/src/app/pages/login-totp/login-totp.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -mat-form-field { - display: block; -} diff --git a/src/app/pages/login-totp/login-totp.component.ts b/src/app/pages/login-totp/login-totp.component.ts deleted file mode 100644 index 5250cc7..0000000 --- a/src/app/pages/login-totp/login-totp.component.ts +++ /dev/null @@ -1,54 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { ActivatedRoute, Router } from '@angular/router'; -import { Auth2FAService } from '../../services/auth.2fa.service'; - -import { environment } from '../../../environments/environment'; - -@Component({ - standalone: false, - selector: 'app-login-totp', - templateUrl: './login-totp.component.html', - styleUrls: ['./login-totp.component.scss'] -}) -export class LoginTotpComponent implements OnInit { - - form: FormGroup; - public loginInvalid: boolean; - public apiUrl = environment.apiUrl; - targetRoute = '/account/info'; - - constructor(private formBuilder: FormBuilder, private auth2FAService: Auth2FAService, private router: Router, private route: ActivatedRoute) { } - - - ngOnInit() { - this.form = this.formBuilder.group({ - code: ['', Validators.required], - keep: [''] - }); - - this.route.queryParams.subscribe({ - next: (params) => { - if (params['target']) { - this.targetRoute = params['target']; - } - } - }); - } - - async loginTotp() { - this.loginInvalid = false; - if (this.form.valid) { - this.auth2FAService.login('totp', this.form.get('code').value, this.form.get('keep').value).subscribe({ - next: (response: any) => { - this.router.navigate([this.targetRoute]); - }, - error: (error) => { - this.loginInvalid = true; - } - }); - - } - } - -} diff --git a/src/app/pages/login/login.component.html b/src/app/pages/login/login.component.html deleted file mode 100644 index aed887d..0000000 --- a/src/app/pages/login/login.component.html +++ /dev/null @@ -1,36 +0,0 @@ -
- - -

{{'login' | i18n}}

- @if (loginInvalid) { - - {{'login.invalid' | i18n}} - - } - - {{'username' | i18n}} - - - {{'username.missing' | i18n}} - - - - {{'password' | i18n}} - - - {{'password.invalid.hint' | i18n}} - - - - {{'login.keepSession' | i18n}} - -
- - - {{'password.forgot' | i18n}} - -
-
\ No newline at end of file diff --git a/src/app/pages/login/login.component.scss b/src/app/pages/login/login.component.scss deleted file mode 100644 index 9ee20ad..0000000 --- a/src/app/pages/login/login.component.scss +++ /dev/null @@ -1,3 +0,0 @@ -mat-form-field { - display: block; -} diff --git a/src/app/pages/login/login.component.ts b/src/app/pages/login/login.component.ts deleted file mode 100644 index af30f28..0000000 --- a/src/app/pages/login/login.component.ts +++ /dev/null @@ -1,71 +0,0 @@ -import { Component, OnInit } from '@angular/core'; -import { FormBuilder, FormGroup, Validators } from '@angular/forms'; -import { ActivatedRoute, Router } from '@angular/router'; -import { AuthService } from './../../services/auth.service'; - -import { environment } from './../../../environments/environment'; - -@Component({ - standalone: false, - selector: 'app-login', - templateUrl: './login.component.html', - styleUrls: ['./login.component.scss'] -}) -export class LoginComponent implements OnInit { - - form: FormGroup; - public loginInvalid: boolean; - public apiUrl = environment.apiUrl; - targetRoute = '/services'; - loginModel = {}; - - constructor( - private formBuilder: FormBuilder, - private authService: AuthService, - private router: Router, - private route: ActivatedRoute) { } - - async ngOnInit() { - this.form = this.formBuilder.group({ - username: ['', Validators.required], - password: ['', Validators.required], - keep: [''] - }); - - this.route.queryParams.subscribe({ - next: (params) => { - if (params['target']) { - this.targetRoute = params['target']; - this.router.navigate([], { queryParams: { target: null }, queryParamsHandling: 'merge' }); - } - } - }); - } - - async login() { - this.loginInvalid = false; - if (this.form.valid) { - - const loginModel = { - username: this.form.get('username').value, - password: this.form.get('password').value, - keep: this.form.get('keep').value - }; - - this.authService.login(loginModel).subscribe({ - next: (response: any) => { - this.router.navigate([this.targetRoute]); - }, - error: (error) => { - if (error.status == 428) { - this.router.navigate(["/login/totp"], { queryParams: { target: this.targetRoute } }); - } else { - this.loginInvalid = true; - } - } - }); - - } - } - -}