feat: Backend typing and openapi schema & codegen

This commit is contained in:
Aleksi Lassila
2024-03-26 23:01:11 +02:00
parent b29907c0e2
commit 7318a0fa99
22 changed files with 376 additions and 179 deletions

View File

@@ -2,10 +2,8 @@ import { Injectable, UnauthorizedException } from '@nestjs/common';
import { UserService } from '../user/user.service';
import { JwtService } from '@nestjs/jwt';
interface AccessTokenPayload {
export interface AccessTokenPayload {
sub: string;
name: string;
isAdmin: boolean;
}
@Injectable()
@@ -29,8 +27,6 @@ export class AuthService {
const payload: AccessTokenPayload = {
sub: user.id,
name: user.name,
isAdmin: user.isAdmin,
};
return {
@@ -38,8 +34,3 @@ export class AuthService {
};
}
}
export type AuthUser = {
id: string;
name: string;
isAdmin: boolean;
};