diff --git a/frontend/src/app/feature/auth/login/login.component.html b/frontend/src/app/feature/auth/login/login.component.html index fee6ce9..14a7d1e 100644 --- a/frontend/src/app/feature/auth/login/login.component.html +++ b/frontend/src/app/feature/auth/login/login.component.html @@ -82,20 +82,27 @@ - +
ODER
- +
- 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 e352952..f905f75 100644 --- a/frontend/src/app/feature/auth/oauth2/oauth2-callback.component.ts +++ b/frontend/src/app/feature/auth/oauth2/oauth2-callback.component.ts @@ -11,7 +11,9 @@ import { AuthService } from '@service/auth.service';

Finishing authentication...

-
+

{{ error }}

@@ -28,7 +30,7 @@ export class OAuth2CallbackComponent implements OnInit { ngOnInit(): void { // Check for code in URL params - this.route.queryParams.subscribe(params => { + this.route.queryParams.subscribe((params) => { const code = params['code']; if (code) { @@ -40,18 +42,18 @@ export class OAuth2CallbackComponent implements OnInit { }, error: (err) => { console.error('GitHub authentication error:', err); - this.error = err.error?.message || "Authentication failed. Please try again."; + this.error = err.error?.message || 'Authentication failed. Please try again.'; console.log('Error details:', err); - + // Redirect back to landing page after showing error setTimeout(() => { this.router.navigate(['/']); }, 3000); - } + }, }); } else { - this.error = "Authentication failed. No authorization code received."; - + this.error = 'Authentication failed. No authorization code received.'; + // Redirect back to landing page after showing error setTimeout(() => { this.router.navigate(['/']); diff --git a/frontend/src/app/service/auth.service.ts b/frontend/src/app/service/auth.service.ts index c517d88..081ad72 100644 --- a/frontend/src/app/service/auth.service.ts +++ b/frontend/src/app/service/auth.service.ts @@ -29,7 +29,7 @@ export class AuthService { this.userSubject = new BehaviorSubject(this.getUserFromStorage()); // Check for token in URL (OAuth callback) on initialization - this.route.queryParams.subscribe(params => { + this.route.queryParams.subscribe((params) => { const token = params['token']; if (token) { this.handleOAuthCallback(token); @@ -48,7 +48,7 @@ export class AuthService { this.router.navigate([], { relativeTo: this.route, queryParams: {}, - replaceUrl: true + replaceUrl: true, }); }