Auth Token Übersendung eingebaut

This commit is contained in:
2024-05-27 18:02:47 -05:00
parent 0473f74241
commit 226d2ebc1e
15 changed files with 131 additions and 123 deletions

View File

@@ -1,12 +1,19 @@
import { Controller, Get } from '@nestjs/common';
import { Controller, Get, Request, UseGuards } from '@nestjs/common';
import { AppService } from './app.service.js';
import { AuthService } from './auth/auth.service.js';
import { JwtAuthGuard } from './jwt-auth/jwt-auth.guard.js';
@Controller()
export class AppController {
constructor(private readonly appService: AppService) {}
constructor(
private readonly appService: AppService,
private authService: AuthService,
) {}
@UseGuards(JwtAuthGuard)
@Get()
getHello(): string {
return this.appService.getHello();
getHello(@Request() req): string {
return req.user;
//return 'dfgdf';
}
}