Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

set cookie using nest js

async login(@Body('username') username: string, @Body('password') password: string, @Res() res: Response) {
    const token = await this.authService.validateUser(username, password);
    res.set('Authorization', 'Bearer ' + token);
    res.send({
        success: true,
        token,
    })
});
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #set #cookie #nest #js
ADD COMMENT
Topic
Name
9+1 =