refactor: share authentication result type

This commit is contained in:
2026-10-01 20:53:00 +03:00
parent 15a3d5f331
commit fb2e851e7e
3 changed files with 14 additions and 12 deletions
@@ -23,7 +23,7 @@ import {
import { ApiProblemResponses } from '../../../common/decorators/api-safe-error-response.decorator';
import { HttpErrorCode } from '../../../common/error-code';
import { AuthService } from '../application/auth.service';
import { AccessPayload } from '../application/auth.types';
import { AccessPayload, AuthenticationResult } from '../application/auth.types';
import { CredentialsDto } from './auth.dto';
import { JwtAuthGuard } from './jwt-auth.guard';
@@ -117,11 +117,7 @@ export class AuthController {
private respond(
response: Response,
result: {
accessToken: string;
refreshToken: string;
user: { email: string; id: string };
},
result: AuthenticationResult,
) {
response.cookie(REFRESH_COOKIE, result.refreshToken, this.cookieOptions());
return { user: result.user, accessToken: result.accessToken };