style: format HTML and TypeScript files
All checks were successful
CI / Get Changed Files (pull_request) Successful in 26s
CI / eslint (pull_request) Successful in 51s
CI / oxlint (pull_request) Successful in 41s
CI / prettier (pull_request) Successful in 52s
CI / Docker frontend validation (pull_request) Successful in 1m46s
CI / Docker backend validation (pull_request) Successful in 29s
CI / Checkstyle Main (pull_request) Successful in 2m44s
CI / test-build (pull_request) Successful in 1m1s

This commit is contained in:
Constantin Simonis 2025-05-21 11:00:01 +02:00
commit 969e2ac0da
No known key found for this signature in database
GPG key ID: 3878FF77C24AF4D2
3 changed files with 24 additions and 15 deletions

View file

@ -94,8 +94,15 @@
(click)="loginWithGithub()" (click)="loginWithGithub()"
class="w-full py-2.5 px-4 rounded flex items-center justify-center bg-gray-800 hover:bg-gray-700 text-white transition-colors" class="w-full py-2.5 px-4 rounded flex items-center justify-center bg-gray-800 hover:bg-gray-700 text-white transition-colors"
> >
<svg class="h-5 w-5 mr-2" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="currentColor"> <svg
<path d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"/> class="h-5 w-5 mr-2"
xmlns="http://www.w3.org/2000/svg"
viewBox="0 0 24 24"
fill="currentColor"
>
<path
d="M12 0C5.37 0 0 5.37 0 12c0 5.31 3.435 9.795 8.205 11.385.6.105.825-.255.825-.57 0-.285-.015-1.23-.015-2.235-3.015.555-3.795-.735-4.035-1.41-.135-.345-.72-1.41-1.23-1.695-.42-.225-1.02-.78-.015-.795.945-.015 1.62.87 1.845 1.23 1.08 1.815 2.805 1.305 3.495.99.105-.78.42-1.305.765-1.605-2.67-.3-5.46-1.335-5.46-5.925 0-1.305.465-2.385 1.23-3.225-.12-.3-.54-1.53.12-3.18 0 0 1.005-.315 3.3 1.23.96-.27 1.98-.405 3-.405s2.04.135 3 .405c2.295-1.56 3.3-1.23 3.3-1.23.66 1.65.24 2.88.12 3.18.765.84 1.23 1.905 1.23 3.225 0 4.605-2.805 5.625-5.475 5.925.435.375.81 1.095.81 2.22 0 1.605-.015 2.895-.015 3.3 0 .315.225.69.825.57A12.02 12.02 0 0 0 24 12c0-6.63-5.37-12-12-12z"
/>
</svg> </svg>
Mit GitHub anmelden Mit GitHub anmelden
</button> </button>

View file

@ -11,7 +11,9 @@ import { AuthService } from '@service/auth.service';
<div class="min-h-screen bg-deep-blue flex items-center justify-center"> <div class="min-h-screen bg-deep-blue flex items-center justify-center">
<div class="text-center"> <div class="text-center">
<h2 class="text-2xl font-bold text-white mb-4">Finishing authentication...</h2> <h2 class="text-2xl font-bold text-white mb-4">Finishing authentication...</h2>
<div class="animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-emerald mx-auto"></div> <div
class="animate-spin rounded-full h-12 w-12 border-t-2 border-b-2 border-emerald mx-auto"
></div>
<p *ngIf="error" class="mt-4 text-accent-red">{{ error }}</p> <p *ngIf="error" class="mt-4 text-accent-red">{{ error }}</p>
</div> </div>
</div> </div>
@ -28,7 +30,7 @@ export class OAuth2CallbackComponent implements OnInit {
ngOnInit(): void { ngOnInit(): void {
// Check for code in URL params // Check for code in URL params
this.route.queryParams.subscribe(params => { this.route.queryParams.subscribe((params) => {
const code = params['code']; const code = params['code'];
if (code) { if (code) {
@ -40,17 +42,17 @@ export class OAuth2CallbackComponent implements OnInit {
}, },
error: (err) => { error: (err) => {
console.error('GitHub authentication 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); console.log('Error details:', err);
// Redirect back to landing page after showing error // Redirect back to landing page after showing error
setTimeout(() => { setTimeout(() => {
this.router.navigate(['/']); this.router.navigate(['/']);
}, 3000); }, 3000);
} },
}); });
} else { } 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 // Redirect back to landing page after showing error
setTimeout(() => { setTimeout(() => {

View file

@ -29,7 +29,7 @@ export class AuthService {
this.userSubject = new BehaviorSubject<User | null>(this.getUserFromStorage()); this.userSubject = new BehaviorSubject<User | null>(this.getUserFromStorage());
// Check for token in URL (OAuth callback) on initialization // Check for token in URL (OAuth callback) on initialization
this.route.queryParams.subscribe(params => { this.route.queryParams.subscribe((params) => {
const token = params['token']; const token = params['token'];
if (token) { if (token) {
this.handleOAuthCallback(token); this.handleOAuthCallback(token);
@ -48,7 +48,7 @@ export class AuthService {
this.router.navigate([], { this.router.navigate([], {
relativeTo: this.route, relativeTo: this.route,
queryParams: {}, queryParams: {},
replaceUrl: true replaceUrl: true,
}); });
} }