Skip to content

Commit 403eccc

Browse files
committed
#RI-4567 - resolve pr comments
1 parent 5f5328c commit 403eccc

File tree

4 files changed

+5
-5
lines changed

4 files changed

+5
-5
lines changed

redisinsight/api/src/modules/auth/window-auth/middleware/window.auth.middleware.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ export class WindowAuthMiddleware implements NestMiddleware {
1313

1414
async use(req: Request, res: Response, next: NextFunction): Promise<any> {
1515
const { windowId } = WindowAuthMiddleware.getWindowIdFromReq(req);
16-
const isWindowExists = (await this.windowAuthService.getStrategy()?.isWindowExists(windowId)) ?? false;
16+
const isAuthorized = (await this.windowAuthService.getStrategy()?.isAuthorized(windowId)) ?? false;
1717

18-
if (!isWindowExists) {
18+
if (!isAuthorized) {
1919
this.throwError(req, ERROR_MESSAGES.UNDEFINED_WINDOW_ID);
2020
}
2121

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
export abstract class AbstractWindowAuthStrategy {
2-
abstract isWindowExists(data: any): Promise<boolean>;
2+
abstract isAuthorized(data: any): Promise<boolean>;
33
}

redisinsight/api/src/modules/auth/window-auth/window-auth.service.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import { WindowAuthService } from './window-auth.service';
33
import { AbstractWindowAuthStrategy } from './strategies/abstract.window.auth.strategy';
44

55
export class TestAuthStrategy extends AbstractWindowAuthStrategy {
6-
async isWindowExists(): Promise<boolean> {
6+
async isAuthorized(): Promise<boolean> {
77
return false;
88
}
99
}

redisinsight/desktop/src/lib/server/server.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import server from '../../../../api/dist/src/main'
1414
const port = config.defaultPort
1515

1616
export class ElectronWindowAuthStrategy extends AbstractWindowAuthStrategy {
17-
async isWindowExists(id: string): Promise<boolean> {
17+
async isAuthorized(id: string): Promise<boolean> {
1818
return getWindows()?.has(id)
1919
}
2020
}

0 commit comments

Comments
 (0)