akveo / ngx-admin-bundle-support

Support repository for ngx-admin backend bundles with issues tracking, instructions and code samples
58 stars 32 forks source link

React Native/ .NET Core Bundle - user.roles is undefined on successful login #95

Open mwoodsmall opened 3 years ago

mwoodsmall commented 3 years ago

After successfully logging in, the user object returned is missing the roles attribute.

This is causing this line to throw an error in the react native app: const isAdmin: boolean = user.roles.findIndex(role => role === 'admin') !== -1; (sign-in.service.ts)

mwoodsmall commented 3 years ago

It looks like the problem is that in UserService.cs the AutoMapper isn't smart enough to map UserRoles from the UserEntity to the UserDTO