Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 3c8b22d642 | |||
| c5da8414f3 | |||
| bd701c687f |
@@ -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
|
||||||
|
|||||||
@@ -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}`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -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,
|
||||||
|
|||||||
@@ -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 !");
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user