mirror of
https://github.com/SyncrowIOT/backend.git
synced 2025-11-26 20:34:55 +00:00
Add platform type to user login and enforce access restrictions
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
import { PlatformType } from '@app/common/constants/platform-type.enum';
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { IsEmail, IsOptional, IsString } from 'class-validator';
|
||||
import { IsEmail, IsEnum, IsOptional, IsString } from 'class-validator';
|
||||
|
||||
export class UserLoginDto {
|
||||
@ApiProperty()
|
||||
@ -20,4 +21,9 @@ export class UserLoginDto {
|
||||
@IsOptional()
|
||||
@IsString()
|
||||
googleCode?: string;
|
||||
|
||||
@ApiProperty()
|
||||
@IsOptional()
|
||||
@IsEnum(PlatformType)
|
||||
platform?: PlatformType;
|
||||
}
|
||||
|
||||
@ -132,6 +132,7 @@ export class UserAuthService {
|
||||
data.email,
|
||||
data.password,
|
||||
data.regionUuid,
|
||||
data.platform,
|
||||
);
|
||||
}
|
||||
const session = await Promise.all([
|
||||
|
||||
Reference in New Issue
Block a user