Fix array checking logic

This commit is contained in:
AbegaM
2024-04-26 13:03:10 +03:00
parent 44b47b0d0f
commit da7b3317a6

View File

@@ -285,7 +285,7 @@ const removeRevokedRefreshTokens = () => {
const getUsersRoleAndPermission = ({ userId }) => {
const userRoles = authService.getUserRoleByUserId({ userId });
if (userRoles <= 0) {
if (userRoles.length <= 0) {
throw new Error(errorMessage.ROLE_NOT_FOUND_ERROR);
}