-
Notifications
You must be signed in to change notification settings - Fork 164
Closed
Description
I am getting the following exception when attempting to login a user with email and password:
System.ArgumentException: Expression of type 'System.Threading.Tasks.Task`1[System.Collections.Generic.List`1[AuthPermissions.DataLayer.Classes.RoleToPermissions]]' cannot be used for return type 'System.Threading.Tasks.Task`1[System.Collections.Generic.IEnumerable`1[AuthPermissions.DataLayer.Classes.RoleToPermissions]]'
at System.Linq.Expressions.Expression.ValidateLambdaArgs(Type delegateType, Expression& body, ReadOnlyCollection`1 parameters, String paramName)
at System.Linq.Expressions.Expression.Lambda[TDelegate](Expression body, String name, Boolean tailCall, IEnumerable`1 parameters)
at Microsoft.EntityFrameworkCore.Query.QueryCompilationContext.CreateQueryExecutor[TResult](Expression query)
at Microsoft.EntityFrameworkCore.Storage.Database.CompileQuery[TResult](Expression query, Boolean async)
The login code is as follows:
var result = await _signInManager.PasswordSignInAsync(request.Email, request.Password, false, false);
if (result.Succeeded)
{
var user = await _userManager.FindByEmailAsync(request.Email);
var token = await _tokenBuilder.GenerateTokenAndRefreshTokenAsync(user.Id);
return Ok(new UserLoginResponse(token.Token, token.RefreshToken));
}
else
{
return BadRequest(new {Message = "Email or password is incorrect"});
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels