26 lines
556 B
TypeScript
26 lines
556 B
TypeScript
import { Controller, Get, Inject } from '@nestjs/common';
|
|
import { ApiOperation } from '@nestjs/swagger';
|
|
import { AppService } from './app.service';
|
|
|
|
@Controller()
|
|
export class AppController {
|
|
constructor(
|
|
private readonly appService: AppService,
|
|
@Inject('JWT_JWKS')
|
|
private readonly jwks: string,
|
|
) {}
|
|
|
|
@Get()
|
|
getHello(): string {
|
|
return this.appService.getHello();
|
|
}
|
|
|
|
@Get('/.well-known/jwks.json')
|
|
@ApiOperation({ summary: 'JWT public key in JWK format' })
|
|
getJWKs() {
|
|
return {
|
|
keys: [this.jwks],
|
|
};
|
|
}
|
|
}
|