Merge pull request #864 from thecodingmachine/singledomain
Adding support for single domain deployments
This commit is contained in:
commit
8529037493
15 changed files with 271 additions and 46 deletions
|
@ -13,8 +13,20 @@ export class BaseController {
|
|||
*/
|
||||
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
||||
protected errorToResponse(e: any, res: HttpResponse): void {
|
||||
console.error(e.message || "An error happened.", e?.config.url);
|
||||
console.error(e.stack || 'no stack defined.');
|
||||
if (e && e.message) {
|
||||
let url = e?.config?.url;
|
||||
if (url !== undefined) {
|
||||
url = ' for URL: '+url;
|
||||
} else {
|
||||
url = '';
|
||||
}
|
||||
console.error('ERROR: '+e.message+url);
|
||||
} else if (typeof(e) === 'string') {
|
||||
console.error(e);
|
||||
}
|
||||
if (e.stack) {
|
||||
console.error(e.stack);
|
||||
}
|
||||
if (e.response) {
|
||||
res.writeStatus(e.response.status+" "+e.response.statusText);
|
||||
this.addCorsHeaders(res);
|
||||
|
|
|
@ -37,7 +37,7 @@ class AdminApi {
|
|||
|
||||
async fetchMapDetails(organizationSlug: string, worldSlug: string, roomSlug: string|undefined): Promise<AdminApiData> {
|
||||
if (!ADMIN_API_URL) {
|
||||
return Promise.reject('No admin backoffice set!');
|
||||
return Promise.reject(new Error('No admin backoffice set!'));
|
||||
}
|
||||
|
||||
const params: { organizationSlug: string, worldSlug: string, roomSlug?: string } = {
|
||||
|
@ -60,7 +60,7 @@ class AdminApi {
|
|||
|
||||
async fetchMemberDataByUuid(uuid: string, roomId: string): Promise<FetchMemberDataByUuidResponse> {
|
||||
if (!ADMIN_API_URL) {
|
||||
return Promise.reject('No admin backoffice set!');
|
||||
return Promise.reject(new Error('No admin backoffice set!'));
|
||||
}
|
||||
const res = await Axios.get(ADMIN_API_URL+'/api/room/access',
|
||||
{ params: {uuid, roomId}, headers: {"Authorization" : `${ADMIN_API_TOKEN}`} }
|
||||
|
@ -70,7 +70,7 @@ class AdminApi {
|
|||
|
||||
async fetchMemberDataByToken(organizationMemberToken: string): Promise<AdminApiData> {
|
||||
if (!ADMIN_API_URL) {
|
||||
return Promise.reject('No admin backoffice set!');
|
||||
return Promise.reject(new Error('No admin backoffice set!'));
|
||||
}
|
||||
//todo: this call can fail if the corresponding world is not activated or if the token is invalid. Handle that case.
|
||||
const res = await Axios.get(ADMIN_API_URL+'/api/login-url/'+organizationMemberToken,
|
||||
|
@ -81,7 +81,7 @@ class AdminApi {
|
|||
|
||||
async fetchCheckUserByToken(organizationMemberToken: string): Promise<AdminApiData> {
|
||||
if (!ADMIN_API_URL) {
|
||||
return Promise.reject('No admin backoffice set!');
|
||||
return Promise.reject(new Error('No admin backoffice set!'));
|
||||
}
|
||||
//todo: this call can fail if the corresponding world is not activated or if the token is invalid. Handle that case.
|
||||
const res = await Axios.get(ADMIN_API_URL+'/api/check-user/'+organizationMemberToken,
|
||||
|
@ -104,7 +104,7 @@ class AdminApi {
|
|||
|
||||
async verifyBanUser(organizationMemberToken: string, ipAddress: string, organization: string, world: string): Promise<AdminBannedData> {
|
||||
if (!ADMIN_API_URL) {
|
||||
return Promise.reject('No admin backoffice set!');
|
||||
return Promise.reject(new Error('No admin backoffice set!'));
|
||||
}
|
||||
//todo: this call can fail if the corresponding world is not activated or if the token is invalid. Handle that case.
|
||||
return Axios.get(ADMIN_API_URL + '/api/check-moderate-user/'+organization+'/'+world+'?ipAddress='+ipAddress+'&token='+organizationMemberToken,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue