Created
March 17, 2020 07:32
-
-
Save StephanSchmidt/949231f0abb2b16d6f923c742dc734da to your computer and use it in GitHub Desktop.
Revisions
-
StephanSchmidt created this gist
Mar 17, 2020 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ @Controller() class AuthController { // constructor(private readonly authService: AuthService) {} constructor() {} // WARNING: // https://docs.nestjs.com/controllers // // Note that when you inject either @Res() or @Response() in a // method handler, you put Nest into Library-specific mode for // that handler, and you become responsible for managing the // response. When doing so, you must issue some kind of response // by making a call on the response object (e.g., res.json(...) or // res.send(...)) @Post("/login/") login(@Res() res: Response) { res.cookie("jwt", "TOKEN", { httpOnly: true, secure: true, }); res.send({ login: "ok" }); } }