Exemple #1
0
        public async Task <Response <AuthInfoDTO> > SignUpMemberEmail(SignUpMemberDTO dto)
        {
            var signUpResult = await _service.SignUpMemberEmail(dto);

            if (!signUpResult.IsSuccess)
            {
                var errorResponse = (ErrorResponse <UserDTO>)signUpResult;

                return(new ErrorResponse <AuthInfoDTO>
                {
                    Message = errorResponse.Message,
                    Code = errorResponse.Code,
                    Errors = errorResponse.Errors,
                    HttpStatusCode = errorResponse.HttpStatusCode
                });
            }

            var resultToken = await _tokensService.Authenticate(new CredentialsDTO
            {
                Password = dto.Password,
                Email    = signUpResult.Data.Email
            });

            return(resultToken);
        }