feat(scanner): add scanner authentication and context services with routes and tests

This commit is contained in:
2026-08-11 14:11:23 -03:00
parent 254faedf2c
commit 3eaa3f8202
12 changed files with 316 additions and 4 deletions

View File

@@ -62,6 +62,29 @@ class PasswordLoginService
);
}
/**
* Authenticate a tenant-bound scanner without requiring its tenant code.
*
* @throws AccountLockedException
* @throws ValidationException
*/
public function authenticateScanner(
string $email,
string $password,
?string $ipAddress,
?string $userAgent,
): User {
return $this->authenticateUser(
$email,
$password,
null,
$ipAddress,
$userAgent,
RoleCode::Scanner,
true,
);
}
private function authenticateUser(
string $email,
string $password,
@@ -210,7 +233,7 @@ class PasswordLoginService
} catch (\Throwable $e) {
Log::error('Failed to trigger reset password on account lock', [
'user_id' => $user->id,
'exception' => $e
'exception' => $e,
]);
}
}