@@ -312,7 +312,10 @@ export class AuthController implements OnModuleInit {
312312 this . apiKeyService . deleteApiKey ( { id } ) ,
313313 ) ;
314314 if ( ! deleteResponse . success ) {
315- throw new HttpException ( 'API Key deletion failed' , HttpStatus . INTERNAL_SERVER_ERROR ) ;
315+ throw new HttpException (
316+ 'API Key deletion failed' ,
317+ HttpStatus . INTERNAL_SERVER_ERROR ,
318+ ) ;
316319 }
317320 return ;
318321 }
@@ -365,27 +368,23 @@ export class AuthController implements OnModuleInit {
365368 @Query ( 'limit' , new DefaultValuePipe ( 10 ) , ParseIntPipe ) limit : number ,
366369 ) {
367370 if ( limit <= 0 ) {
368- throw new HttpException ( 'limit must be a positive integer' , HttpStatus . BAD_REQUEST ) ;
371+ throw new HttpException (
372+ 'limit must be a positive integer' ,
373+ HttpStatus . BAD_REQUEST ,
374+ ) ;
369375 }
370- ) {
376+
371377 if ( ! user ) {
372378 throw new UnauthorizedException ( 'User ID token is required' ) ;
373379 }
374380
375381 let obs : Observable < ApiKeyProto . GetAllApiKeysResponse > ;
376382 if ( user . type == CommonProto . UserType . SUPERADMIN ) {
377- // superadmins can list all projects
378- const projects = (
379- await lastValueFrom (
380- this . projectService . getAllProjects ( { projectIds : [ ] } ) ,
381- )
382- ) . projects ;
383+ // superadmins can list all keys — pass empty projects to skip filtering
383384 obs = this . apiKeyService . getAllApiKeys ( {
384385 offset,
385386 limit,
386- projects : projects . map ( ( proj ) =>
387- proj . id ? { id : proj . id } : { name : proj . name } ,
388- ) ,
387+ projects : [ ] ,
389388 } ) ;
390389 } else if ( user . type == CommonProto . UserType . ADMIN && user . projectIds ) {
391390 // regular users can only list keys for projects which they are an admin for
0 commit comments