|
|
@ -14,7 +14,7 @@ export async function apiTokenCreate(req: Request, res: Response) { |
|
|
|
res.json(await ApiToken.insert({ ...req.body, fk_user_id: req['user'].id })); |
|
|
|
res.json(await ApiToken.insert({ ...req.body, fk_user_id: req['user'].id })); |
|
|
|
} |
|
|
|
} |
|
|
|
export async function apiTokenDelete(req: Request, res: Response) { |
|
|
|
export async function apiTokenDelete(req: Request, res: Response) { |
|
|
|
const apiToken = await ApiToken.getByToken(req.params.apiTokenId); |
|
|
|
const apiToken = await ApiToken.getByToken(req.params.token); |
|
|
|
if ( |
|
|
|
if ( |
|
|
|
!req['user'].roles.includes(OrgUserRoles.SUPER_ADMIN) && |
|
|
|
!req['user'].roles.includes(OrgUserRoles.SUPER_ADMIN) && |
|
|
|
apiToken.fk_user_id !== req['user'].id |
|
|
|
apiToken.fk_user_id !== req['user'].id |
|
|
|