Fixed automated code review warnings

This commit is contained in:
jd
2026-02-18 21:38:31 +00:00
parent 035397ea25
commit 0f6452fdd4
2 changed files with 5 additions and 8 deletions

View File

@@ -3,16 +3,14 @@ import jwt from 'jsonwebtoken';
import { UnwrappedRequest } from '../utilities/guard';
import { ErrorResponse, OkResponse, UnauthorizedResponse } from '../utilities/responseHelper';
import { Claims } from '../orm/claims';
import { UnauthorizedError } from '../utilities/errors';
import { ChangePasswordRequest, LoginRequest, SecureId } from '../utilities/requestModels';
async function login(request: UnwrappedRequest): Promise<Response> {
async function login(request: UnwrappedRequest<LoginRequest>): Promise<Response> {
try {
const requestBody = request.body as LoginRequest;
const verify: {
userId: SecureId;
refreshCount: string;
} | null = await orm.users.verifyCredentials(requestBody.username, requestBody.password);
} | null = await orm.users.verifyCredentials(request.body.username, request.body.password);
if (!verify) {
return new UnauthorizedResponse('Invalid credentials');
}