Alex
05/17/2023, 9:32 AMrp_st
05/17/2023, 9:37 AMAlex
05/17/2023, 9:41 AMhttps://cdn.discordapp.com/attachments/1108326124808843335/1108328308510294086/image.png▾
Alex
05/17/2023, 9:41 AMrp_st
05/17/2023, 9:41 AMawait session.getClaimValue(UserRoles.UserRoleClaim)
?Alex
05/17/2023, 9:53 AMAlex
05/17/2023, 9:53 AMrp_st
05/17/2023, 10:05 AMAlex
05/19/2023, 1:25 PMhttps://cdn.discordapp.com/attachments/1108326124808843335/1109109672381788270/image.png▾
rp_st
05/19/2023, 2:54 PMrp_st
05/19/2023, 2:54 PMrp_st
05/19/2023, 2:54 PMAlex
05/20/2023, 12:37 PMhttps://cdn.discordapp.com/attachments/1108326124808843335/1109459766348107816/image.png▾
Alex
05/20/2023, 12:37 PMrp_st
05/20/2023, 3:32 PMrp_st
05/20/2023, 3:33 PMAlex
05/20/2023, 5:18 PM@UsePipes(ValidationPipe)
@Post('/sign-in')
async signInUser(
@Body() signInDto: SignInDto,
@Res() res: Response,
@Req() req: Request,
) {
const { email, password } = signInDto;
const userData = await this.authService.signIn(email, password);
if (userData.status === 401) {
return res.status(401).json({ error: userData.message });
}
await createNewSession(req, res, userData.id);
rp_st
05/20/2023, 6:00 PMAlex
05/21/2023, 6:18 AMAlex
05/21/2023, 9:52 AMrp_st
05/21/2023, 2:38 PMawait response.session.fetchAndSetClaim(UserRoleClaim)
in your override where resopnse
is the result of calling the original implementaiton.
Our docs does mention this here: https://supertokens.com/docs/userroles/managing-roles-and-users