diff --git a/src/routes/api/v1/account/accountId/tokens.ts b/src/routes/api/v1/account/accountId/tokens.ts index 2ea55664..35a20376 100755 --- a/src/routes/api/v1/account/accountId/tokens.ts +++ b/src/routes/api/v1/account/accountId/tokens.ts @@ -31,7 +31,7 @@ import { AuthToken } from '@Entities/AuthToken'; const procGetAccountTokens: RequestHandler = async (req: Request, resp: Response, next: NextFunction) => { if (req.vRestResp && req.vAuthAccount && req.vAccount) { const pager = new PaginationInfo(); - const scoper = new AccountScopeFilter(req.vAuthAccount); + const scoper = new AccountScopeFilter(req.vAuthAccount, 'accountId'); pager.parametersFromRequest(req); scoper.parametersFromRequest(req); const acctFilter = new GenericFilter( { 'accountId': req.vAccount.id } ); diff --git a/src/routes/api/v1/account/accountId/tokens/tokenId.ts b/src/routes/api/v1/account/accountId/tokens/tokenId.ts index 7d839bc7..f81c68d7 100755 --- a/src/routes/api/v1/account/accountId/tokens/tokenId.ts +++ b/src/routes/api/v1/account/accountId/tokens/tokenId.ts @@ -32,13 +32,13 @@ import { Accounts } from '@Entities/Accounts'; // either 'vAuthAccount' is an admin or is the same as 'vAccount'. const procDeleteToken: RequestHandler = async (req: Request, resp: Response, next: NextFunction) => { if (req.vRestResp && req.vAuthAccount && req.vAccount && req.vTokenId) { - const scoper = new AccountScopeFilter(req.vAuthAccount); + const scoper = new AccountScopeFilter(req.vAuthAccount, 'accountId'); scoper.parametersFromRequest(req); const tok = await Tokens.getTokenWithTokenId(req.vTokenId); if (tok) { if ( scoper.AsAdmin() && Accounts.isAdmin(req.vAuthAccount) - || req.vAuthAccount.id === tok.accountId) { + || req.vAuthAccount.id === tok.accountId) { if (req.vAccount.id === tok.accountId) { await Tokens.removeToken(tok); } diff --git a/src/routes/api/v1/tokens.ts b/src/routes/api/v1/tokens.ts index e4eb3037..87126680 100755 --- a/src/routes/api/v1/tokens.ts +++ b/src/routes/api/v1/tokens.ts @@ -28,7 +28,7 @@ const procGetTokens: RequestHandler = async (req: Request, resp: Response, next: Logger.debug('procGetTokens'); if (req.vAuthAccount) { const pager = new PaginationInfo(); - const scoper = new AccountScopeFilter(req.vAuthAccount); + const scoper = new AccountScopeFilter(req.vAuthAccount, 'accountId'); pager.parametersFromRequest(req); scoper.parametersFromRequest(req); diff --git a/src/routes/api/v1/user/places.ts b/src/routes/api/v1/user/places.ts index bc4e8222..71cfa346 100755 --- a/src/routes/api/v1/user/places.ts +++ b/src/routes/api/v1/user/places.ts @@ -29,7 +29,6 @@ import { Places } from '@Entities/Places'; import { Maturity } from '@Entities/Sets/Maturity'; import { PaginationInfo } from '@Entities/EntityFilters/PaginationInfo'; -import { AccountScopeFilter } from '@Entities/EntityFilters/AccountScopeFilter'; import { PlaceFilterInfo } from '@Entities/EntityFilters/PlaceFilterInfo'; import { Domains } from '@Entities/Domains';