Alexxkr1
05/17/2023, 9:32 AMrp
05/17/2023, 9:37 AMAlexxkr1
05/17/2023, 9:41 AMhttps://cdn.discordapp.com/attachments/1108326124808843335/1108328308510294086/image.png▾
rp
05/17/2023, 9:41 AMawait session.getClaimValue(UserRoles.UserRoleClaim)
?Alexxkr1
05/17/2023, 9:53 AMrp
05/17/2023, 10:05 AMAlexxkr1
05/19/2023, 1:25 PMhttps://cdn.discordapp.com/attachments/1108326124808843335/1109109672381788270/image.png▾
rp
05/19/2023, 2:54 PMAlexxkr1
05/20/2023, 12:37 PMhttps://cdn.discordapp.com/attachments/1108326124808843335/1109459766348107816/image.png▾
rp
05/20/2023, 3:32 PMAlexxkr1
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
05/20/2023, 6:00 PMAlexxkr1
05/21/2023, 6:18 AMrp
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