fix and update
This commit is contained in:
@@ -1,4 +1,6 @@
|
||||
import { Body, Controller, Get, Headers, Ip, Param, Post } from '@nestjs/common';
|
||||
import { Body, Controller, Get, Headers, Param, Post, Req } from '@nestjs/common';
|
||||
import type { Request } from 'express';
|
||||
import { enrichAuthClientMeta } from '../client-request.util';
|
||||
import { JwtService } from '@nestjs/jwt';
|
||||
import { ApiBearerAuth, ApiBody, ApiOperation, ApiParam, ApiResponse, ApiTags } from '@nestjs/swagger';
|
||||
import { CoreGrpcService } from '../core-grpc.service';
|
||||
@@ -33,14 +35,14 @@ export class AdvancedAuthController {
|
||||
@ApiOperation({ summary: 'Создать QR-сессию', description: 'Создает временную QR-сессию для входа с другого устройства.' })
|
||||
@ApiBody({ type: QrSessionDto })
|
||||
@ApiResponse({ status: 201, description: 'QR-сессия создана' })
|
||||
createQr(@Body() dto: QrSessionDto, @Ip() ipAddress?: string, @Headers('user-agent') userAgent?: string) {
|
||||
return this.core.advancedAuth.CreateQrSession({
|
||||
deviceName: dto.deviceName,
|
||||
fingerprint: dto.fingerprint,
|
||||
deviceType: dto.deviceType ?? 'WEB',
|
||||
ipAddress,
|
||||
userAgent
|
||||
});
|
||||
createQr(@Body() dto: QrSessionDto, @Req() req: Request) {
|
||||
return this.core.advancedAuth.CreateQrSession(
|
||||
enrichAuthClientMeta(req, {
|
||||
deviceName: dto.deviceName,
|
||||
fingerprint: dto.fingerprint,
|
||||
deviceType: dto.deviceType ?? 'WEB'
|
||||
})
|
||||
);
|
||||
}
|
||||
|
||||
@Get('qr/session/:sessionId')
|
||||
|
||||
Reference in New Issue
Block a user