check JWT server side for for specific calls #18

Closed
opened 2024-05-17 18:42:59 +00:00 by aknuth · 2 comments
Owner
No description provided.
aknuth added this to the Validation project 2024-05-17 18:43:02 +00:00
aknuth self-assigned this 2024-05-27 22:56:17 +00:00
Author
Owner

JwtStrategy sowie JwtAuthGuard && OptionalJwtAuthGuard implementiert. Der Access Token wird übermittelt und kann im Endpunkt über req.user?.username abgefragt werden.

@UseGuards(OptionalJwtAuthGuard) @Get('user/:userid') findByUserId(@Request() req, @Param('userid') userid: string): any { console.log(req.user?.username); return this.listingsService.findByUserId(userid, commercials, req.user?.username); }

JwtStrategy sowie JwtAuthGuard && OptionalJwtAuthGuard implementiert. Der Access Token wird übermittelt und kann im Endpunkt über req.user?.username abgefragt werden. ` @UseGuards(OptionalJwtAuthGuard) @Get('user/:userid') findByUserId(@Request() req, @Param('userid') userid: string): any { console.log(req.user?.username); return this.listingsService.findByUserId(userid, commercials, req.user?.username); } `
aknuth added the
Improvement
label 2024-08-13 08:51:16 +00:00
Author
Owner

JwtAuthGuard: token must be present
AdminAuthGuard: token + Admin Role must be present
OptionalJwtAuthGuard: Token will be taken for user infos if present

JwtAuthGuard: token must be present AdminAuthGuard: token + Admin Role must be present OptionalJwtAuthGuard: Token will be taken for user infos if present
Sign in to join this conversation.
No Milestone
No project
No Assignees
1 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: aknuth/bizmatch-project#18
No description provided.