From f3ab9ffcd6023a89f0e2db12f7d422d4944764d4 Mon Sep 17 00:00:00 2001 From: Constantin Simonis Date: Wed, 21 May 2025 11:56:14 +0200 Subject: [PATCH] style: format code and improve readability --- frontend/src/app/app.routes.ts | 2 +- .../feature/auth/oauth2/oauth2-callback.component.ts | 5 +++-- frontend/src/app/feature/auth/oauth2/oauth2.service.ts | 10 +++++----- 3 files changed, 9 insertions(+), 8 deletions(-) diff --git a/frontend/src/app/app.routes.ts b/frontend/src/app/app.routes.ts index 1afd767..44c342a 100644 --- a/frontend/src/app/app.routes.ts +++ b/frontend/src/app/app.routes.ts @@ -52,7 +52,7 @@ export const routes: Routes = [ ), data: { provider: 'google' }, }, - ] + ], }, { path: 'game/blackjack', diff --git a/frontend/src/app/feature/auth/oauth2/oauth2-callback.component.ts b/frontend/src/app/feature/auth/oauth2/oauth2-callback.component.ts index 891772d..ebd2688 100644 --- a/frontend/src/app/feature/auth/oauth2/oauth2-callback.component.ts +++ b/frontend/src/app/feature/auth/oauth2/oauth2-callback.component.ts @@ -1,7 +1,6 @@ import { Component, computed, inject, OnInit, Signal } from '@angular/core'; import { CommonModule } from '@angular/common'; import { ActivatedRoute, Router } from '@angular/router'; -import { AuthService } from '@service/auth.service'; import { Oauth2Service } from './oauth2.service'; @Component({ @@ -35,7 +34,9 @@ export class OAuth2CallbackComponent implements OnInit { if (code) { this.oauthService.oauth(provider, code); } else { - this.oauthService.error.set('Authentifizierung fehlgeschlagen. Bitte versuchen Sie es erneut.'); + this.oauthService.error.set( + 'Authentifizierung fehlgeschlagen. Bitte versuchen Sie es erneut.' + ); setTimeout(() => { this.router.navigate(['/']); diff --git a/frontend/src/app/feature/auth/oauth2/oauth2.service.ts b/frontend/src/app/feature/auth/oauth2/oauth2.service.ts index 2022300..79ad6d9 100644 --- a/frontend/src/app/feature/auth/oauth2/oauth2.service.ts +++ b/frontend/src/app/feature/auth/oauth2/oauth2.service.ts @@ -2,7 +2,6 @@ import { inject, Injectable, signal } from '@angular/core'; import { Router } from '@angular/router'; import { AuthService } from '@service/auth.service'; - @Injectable({ providedIn: 'root', }) @@ -12,16 +11,17 @@ export class Oauth2Service { private _error = signal(''); oauth(provider: string, code: string) { - const oauth$ = provider === 'github' - ? this.authService.githubAuth(code) - : this.authService.googleAuth(code); + const oauth$ = + provider === 'github' ? this.authService.githubAuth(code) : this.authService.googleAuth(code); oauth$.subscribe({ next: () => { this.router.navigate(['/home']); }, error: (err) => { - this._error.set(err.error?.message || 'Authentifizierung fehlgeschlagen. Bitte versuchen Sie es erneut.'); + this._error.set( + err.error?.message || 'Authentifizierung fehlgeschlagen. Bitte versuchen Sie es erneut.' + ); setTimeout(() => { this.router.navigate(['/']);