@@ -31,6 +31,7 @@ import {
3131 Delete ,
3232 Query ,
3333 NotFoundException ,
34+ ParseIntPipe ,
3435} from "@nestjs/common" ;
3536import { ApiOperation , ApiTags as DocsTags , ApiHeader } from "@nestjs/swagger" ;
3637
@@ -111,7 +112,7 @@ export class OAuthClientUsersController {
111112 @MembershipRoles ( [ MembershipRole . ADMIN , MembershipRole . OWNER ] )
112113 async getUserById (
113114 @Param ( "clientId" ) clientId : string ,
114- @Param ( "userId" ) userId : number
115+ @Param ( "userId" , ParseIntPipe ) userId : number
115116 ) : Promise < GetManagedUserOutput > {
116117 const user = await this . validateManagedUserOwnership ( clientId , userId ) ;
117118
@@ -127,7 +128,7 @@ export class OAuthClientUsersController {
127128 @MembershipRoles ( [ MembershipRole . ADMIN , MembershipRole . OWNER ] )
128129 async updateUser (
129130 @Param ( "clientId" ) clientId : string ,
130- @Param ( "userId" ) userId : number ,
131+ @Param ( "userId" , ParseIntPipe ) userId : number ,
131132 @Body ( ) body : UpdateManagedUserInput ,
132133 @GetOrgId ( ) organizationId : number
133134 ) : Promise < GetManagedUserOutput > {
@@ -153,7 +154,7 @@ export class OAuthClientUsersController {
153154 @MembershipRoles ( [ MembershipRole . ADMIN , MembershipRole . OWNER ] )
154155 async deleteUser (
155156 @Param ( "clientId" ) clientId : string ,
156- @Param ( "userId" ) userId : number
157+ @Param ( "userId" , ParseIntPipe ) userId : number
157158 ) : Promise < GetManagedUserOutput > {
158159 const user = await this . validateManagedUserOwnership ( clientId , userId ) ;
159160 await this . userRepository . delete ( userId ) ;
@@ -174,7 +175,7 @@ export class OAuthClientUsersController {
174175 } )
175176 @MembershipRoles ( [ MembershipRole . ADMIN , MembershipRole . OWNER ] )
176177 async forceRefresh (
177- @Param ( "userId" ) userId : number ,
178+ @Param ( "userId" , ParseIntPipe ) userId : number ,
178179 @Param ( "clientId" ) oAuthClientId : string
179180 ) : Promise < KeysResponseDto > {
180181 this . logger . log ( `Forcing new access tokens for managed user with ID ${ userId } ` ) ;
0 commit comments