Fixed auto logout
MODIFY
src/server/rest/v1/service/SessionHashService.ts
src/server/rest/v1/service/SessionHashService.ts
@@ -3,6 +3,7 @@ import { NextFunction, Request, Response } from 'express';
import AppError from '../../../../exception/AppError';
import Constants from '../../../../utils/Constants';
import Cypher from '../../../../utils/Cypher';
+import { HTTPError } from '../../../../types/HTTPError';
import Logging from '../../../../utils/Logging';
import { ServerAction } from '../../../../types/Server';
import { StatusCodes } from 'http-status-codes';
@@ -39,7 +40,7 @@ export default class SessionHashService {
if (userHashID !== this.buildUserHashID(user)) {
throw new AppError({
source: Constants.CENTRAL_SERVER,
- errorCode: StatusCodes.FORBIDDEN,
+ errorCode: HTTPError.USER_ACCOUNT_CHANGED,
message: 'User has been updated and will be logged off',
module: MODULE_NAME,
method: 'isSessionHashUpdated',
@@ -50,7 +51,7 @@ export default class SessionHashService {
if (tenantHashID !== this.buildTenantHashID(tenant)) {
throw new AppError({
source: Constants.CENTRAL_SERVER,
- errorCode: StatusCodes.FORBIDDEN,
+ errorCode: HTTPError.TENANT_COMPONENT_CHANGED,
message: 'Tenant has been updated and all users will be logged off',
module: MODULE_NAME,
method: 'isSessionHashUpdated',

MODIFY
src/types/HTTPError.ts
src/types/HTTPError.ts
@@ -32,6 +32,8 @@ export enum HTTPError {
USER_ACCOUNT_PENDING_ERROR = 592,
USER_ACCOUNT_BLOCKED_ERROR = 593,
USER_ACCOUNT_INACTIVE_ERROR = 594,
+ USER_ACCOUNT_CHANGED = 595,
+ TENANT_COMPONENT_CHANGED = 596,
INVALID_CAPTCHA = 530,
INVALID_TOKEN_ERROR = 540,

Fixed auto logout