3 Commits

Author SHA1 Message Date
3c8b22d642 fix: show relative backend url in production
All checks were successful
continuous-integration/drone/push Build is passing
2026-04-02 21:23:30 +02:00
c5da8414f3 fix: not showing an error when SSO login fail on login page
All checks were successful
continuous-integration/drone/push Build is passing
2026-04-02 21:20:30 +02:00
bd701c687f fix: qr code generation issue 2026-04-02 21:19:04 +02:00
4 changed files with 14 additions and 2 deletions

View File

@@ -25,6 +25,15 @@ export class APIClient {
return URL; return URL;
} }
/**
* Get the full URL at which the backend can be contacted
*/
static ActualBackendURL(): string {
const backendURL = this.backendURL();
if (backendURL.startsWith("/")) return `${location.origin}${backendURL}`;
else return backendURL;
}
/** /**
* Check out whether the backend is accessed through * Check out whether the backend is accessed through
* HTTPS or not * HTTPS or not

View File

@@ -38,7 +38,7 @@ export class AccommodationsCalendarURLApi {
* Get accommodation calendar URL route * Get accommodation calendar URL route
*/ */
static CalendarURL(c: AccommodationCalendarURL): string { static CalendarURL(c: AccommodationCalendarURL): string {
return `${APIClient.backendURL()}/acccommodations_calendar/${c.token}`; return `${APIClient.ActualBackendURL()}/acccommodations_calendar/${c.token}`;
} }
/** /**

View File

@@ -12,7 +12,9 @@ import {
OutlinedInput, OutlinedInput,
Typography, Typography,
} from "@mui/material"; } from "@mui/material";
import QRCode from "react-qr-code"; // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore
import { QRCode } from "react-qr-code";
import { import {
AccommodationCalendarURL, AccommodationCalendarURL,
AccommodationsCalendarURLApi, AccommodationsCalendarURLApi,

View File

@@ -87,6 +87,7 @@ export function LoginRoute(): React.ReactElement {
// eslint-disable-next-line react-hooks/immutability // eslint-disable-next-line react-hooks/immutability
window.location.href = res.url; window.location.href = res.url;
} catch (e) { } catch (e) {
setLoading(false);
console.error(e); console.error(e);
setError("Echec de l'initialisation de l'authentification OpenID !"); setError("Echec de l'initialisation de l'authentification OpenID !");
} }