mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage-server
synced 2026-04-11 18:08:16 +00:00
fix: strict duplicate login lockout — one device per agent
Block any login attempt when a session exists, regardless of user identity. Same user on second device is blocked until logout or TTL expiry. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -127,9 +127,9 @@ export class AuthController {
|
|||||||
throw new HttpException('Agent account not configured. Contact administrator.', 403);
|
throw new HttpException('Agent account not configured. Contact administrator.', 403);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Check for duplicate login
|
// Check for duplicate login — strict: one device only
|
||||||
const existingSession = await this.sessionService.isSessionLocked(agentConfig.ozonetelAgentId);
|
const existingSession = await this.sessionService.isSessionLocked(agentConfig.ozonetelAgentId);
|
||||||
if (existingSession && existingSession !== memberId) {
|
if (existingSession) {
|
||||||
throw new HttpException('You are already logged in on another device. Please log out there first.', 409);
|
throw new HttpException('You are already logged in on another device. Please log out there first.', 409);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user