More eslint fixes (+ ignoring no-unsafe-argument rule for now)
This commit is contained in:
parent
98d3a58861
commit
0c281db411
9 changed files with 76 additions and 21 deletions
|
@ -6,6 +6,7 @@ import { AuthTokenData, jwtTokenManager } from "../Services/JWTTokenManager";
|
|||
import { parse } from "query-string";
|
||||
import { openIDClient } from "../Services/OpenIDClient";
|
||||
import { DISABLE_ANONYMOUS, FRONT_URL } from "../Enum/EnvironmentVariable";
|
||||
import { RegisterData } from "../../../messages/JsonMessages/RegisterData";
|
||||
|
||||
export interface TokenInterface {
|
||||
userUuid: string;
|
||||
|
@ -191,7 +192,7 @@ export class AuthenticateController extends BaseController {
|
|||
mapUrlStart,
|
||||
organizationMemberToken,
|
||||
textures,
|
||||
})
|
||||
} as RegisterData)
|
||||
);
|
||||
} catch (e) {
|
||||
console.error("register => ERROR", e);
|
||||
|
|
|
@ -1,20 +1,10 @@
|
|||
import { ADMIN_API_TOKEN, ADMIN_API_URL, ADMIN_URL, OPID_PROFILE_SCREEN_PROVIDER } from "../Enum/EnvironmentVariable";
|
||||
import Axios from "axios";
|
||||
import { GameRoomPolicyTypes } from "_Model/PusherRoom";
|
||||
import { CharacterTexture} from "../Messages/JsonMessages/CharacterTexture";
|
||||
import { MapDetailsData} from "../Messages/JsonMessages/MapDetailsData";
|
||||
import { RoomRedirect} from "../Messages/JsonMessages/RoomRedirect";
|
||||
|
||||
export interface AdminApiData {
|
||||
roomUrl: string;
|
||||
email: string | null;
|
||||
mapUrlStart: string;
|
||||
tags: string[];
|
||||
policy_type: number;
|
||||
userUuid: string;
|
||||
messages?: unknown[];
|
||||
textures: CharacterTexture[];
|
||||
}
|
||||
import { CharacterTexture } from "../Messages/JsonMessages/CharacterTexture";
|
||||
import { MapDetailsData } from "../Messages/JsonMessages/MapDetailsData";
|
||||
import { RoomRedirect } from "../Messages/JsonMessages/RoomRedirect";
|
||||
import { AdminApiData, isAdminApiData } from "../Messages/JsonMessages/AdminApiData";
|
||||
|
||||
export interface AdminBannedData {
|
||||
is_banned: boolean;
|
||||
|
@ -77,6 +67,10 @@ class AdminApi {
|
|||
const res = await Axios.get(ADMIN_API_URL + "/api/login-url/" + organizationMemberToken, {
|
||||
headers: { Authorization: `${ADMIN_API_TOKEN}` },
|
||||
});
|
||||
if (!isAdminApiData(res.data)) {
|
||||
console.error("Message received from /api/login-url is not in the expected format. Message: ", res.data);
|
||||
throw new Error("Message received from /api/login-url is not in the expected format.");
|
||||
}
|
||||
return res.data;
|
||||
}
|
||||
|
||||
|
@ -88,6 +82,10 @@ class AdminApi {
|
|||
const res = await Axios.get(ADMIN_API_URL + "/api/check-user/" + organizationMemberToken, {
|
||||
headers: { Authorization: `${ADMIN_API_TOKEN}` },
|
||||
});
|
||||
if (!isAdminApiData(res.data)) {
|
||||
console.error("Message received from /api/check-user is not in the expected format. Message: ", res.data);
|
||||
throw new Error("Message received from /api/check-user is not in the expected format.");
|
||||
}
|
||||
return res.data;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue