Ejemplo n.º 1
0
        public async Task <Result> Handle(Command request, CancellationToken ct)
        {
            // TODO: get from UserfyOptions
            request.ReturnUrl ??= "/";

            var result = await _userLogin.LoginAsync(request.Email, request.Password, request.RememberMe);

            if (result.Succeeded)
            {
                return(new Result
                {
                    RedirectTo = request.ReturnUrl,
                    SignInResult = result
                });
            }

            // TODO: get message from UserfyOptions
            throw new DomainException("User and password not found");
        }