Merge remote-tracking branch 'stonith404/main' into main

This commit is contained in:
Elias Schneider
2022-10-16 00:08:37 +02:00
47 changed files with 6692 additions and 881 deletions

View File

@@ -27,6 +27,7 @@ export class AuthController {
}
@Post("signIn")
@HttpCode(200)
signIn(@Body() dto: AuthSignInDTO) {
return this.authService.signIn(dto);
}

View File

@@ -1,4 +1,3 @@
import { PickType } from "@nestjs/swagger";
import { UserDTO } from "src/user/dto/user.dto";
export class AuthRegisterDTO extends UserDTO {}

View File

@@ -1,4 +1,4 @@
import { IsNotEmpty, IsString } from "class-validator";
import { IsNotEmpty } from "class-validator";
export class RefreshAccessTokenDTO {
@IsNotEmpty()

View File

@@ -14,7 +14,7 @@ export class JwtStrategy extends PassportStrategy(Strategy) {
});
}
async validate(payload: any) {
async validate(payload: { sub: string }) {
const user: User = await this.prisma.user.findUnique({
where: { id: payload.sub },
});