fix: route tournament calls through backend gateway

Use relative /api/tournament path instead of hardcoded
http://141.37.123.132:8086. The browser was hitting the external
tournament-server directly with the user's RS256 token, which it
rejects. Routing through our backend lets it publish to the native
server with the auto-registered director token.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
2026-06-23 14:52:31 +02:00
parent a98b5534b7
commit 890c3fcecc
+1 -2
View File
@@ -2,7 +2,6 @@ import { Injectable, inject } from '@angular/core';
import { HttpClient, HttpHeaders } from '@angular/common/http';
import { Observable } from 'rxjs';
import { Tournament, TournamentList, RoundPairings } from '../models/tournament.models';
import { environment } from '../../environments/environment';
export interface CreateTournamentForm {
name: string;
@@ -15,7 +14,7 @@ export interface CreateTournamentForm {
@Injectable({ providedIn: 'root' })
export class TournamentService {
private readonly http = inject(HttpClient);
private readonly base = `${(environment.tournamentServerUrl ?? '').replace(/\/+$/, '')}/api/tournament`;
private readonly base = '/api/tournament';
list(): Observable<TournamentList> {
return this.http.get<TournamentList>(this.base);