feat(api): user authentication

This commit is contained in:
Julian Tölle 2020-02-01 16:11:48 +01:00
parent f14eda16ac
commit f253a66f86
41 changed files with 657 additions and 338 deletions

View file

@ -0,0 +1,17 @@
import { Controller, Get } from "@nestjs/common";
import { Auth } from "../auth/decorators/auth.decorator";
import { ReqUser } from "../auth/decorators/req-user.decorator";
import { User } from "./user.entity";
@Controller("api/v1/users")
export class UsersController {
@Get("me")
@Auth()
getMe(@ReqUser() user: User): Omit<User, "spotify"> {
return {
id: user.id,
displayName: user.displayName,
photo: user.photo
};
}
}