Change type of unauthorized (#2123)
* Change type of unauthorized * Fix redirect on received erroScreenMessage from API
This commit is contained in:
@@ -6,7 +6,6 @@ import { ReconnectingTextures } from "../Reconnecting/ReconnectingScene";
|
||||
import { localeDetector } from "../../i18n/locales";
|
||||
import { errorScreenStore } from "../../Stores/ErrorScreenStore";
|
||||
import { isErrorApiData } from "../../Messages/JsonMessages/ErrorApiData";
|
||||
import { connectionManager } from "../../Connexion/ConnectionManager";
|
||||
|
||||
export const EntrySceneName = "EntryScene";
|
||||
|
||||
@@ -49,9 +48,7 @@ export class EntryScene extends Scene {
|
||||
.catch((err) => {
|
||||
const errorType = isErrorApiData.safeParse(err?.response?.data);
|
||||
if (errorType.success) {
|
||||
if (errorType.data.type === "unauthorized") {
|
||||
void connectionManager.logout();
|
||||
} else if (errorType.data.type === "redirect") {
|
||||
if (errorType.data.type === "redirect") {
|
||||
window.location.assign(errorType.data.urlToRedirect);
|
||||
} else errorScreenStore.setError(err?.response?.data);
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user