Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,15 @@ export class RocketsJwtAuthAdapter implements AuthAdapterInterface {
}

const user = userAggregateToEntity(userResult);

// Honor the user's active flag on EVERY request, matching login semantics
// (LocalService throws LocalUserInactiveException): a deactivated user's
// outstanding access tokens must stop working immediately.
if (user.active !== true) {
this.logger.warn(`User inactive for subject: ${payload.sub}`);
throw new UnauthorizedException('User inactive');
}

const userRoles = await resolveUserRoles(this.queryBus, user.id);

this.logger.log(`Successfully validated token for user: ${payload.sub}`);
Expand Down
1 change: 1 addition & 0 deletions scripts/patch-concepta-runtime-context.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ const files = [
'node_modules/@concepta/nestjs-common/dist/model/exceptions/model-id-no-match.exception.js',
'node_modules/@concepta/nestjs-crud/dist/infrastructure/exceptions/crud.exception.js',
'node_modules/@concepta/nestjs-crud/dist/infrastructure/exceptions/crud-query.exception.js',
'node_modules/@concepta/nestjs-repository/dist/exceptions/repository-query.exception.js',
];

const needle = 'Object.assign({}, super.context)';
Expand Down
Loading