public async Task <IActionResult> Register(RegisterModel userModel) { if (ModelState.IsValid) { UserApiRepository.AddUser(userModel); } if (await UserMgr.FindByEmailAsync(userModel.Email) != null) { return(View("Login")); } return(View()); }
public ActionResult <dynamic> Authenticate([FromBody] UserApi userApi) { var user = UserApiRepository.Get(userApi.Username, userApi.Password); if (user == null) { return(NotFound(new { message = "Usuário ou senha inválidos!" })); } var token = TokenService.GenerateToken(user); return(new { token }); }
public async Task <int> GetUserInvitePointsForChallenge(string usuarioId) { return(await UserApiRepository.Get().GetUserInvitePointsForChallenge(usuarioId)); }
public async Task UpdateUserPoints(UpdateUserPointsRequest request) { await UserApiRepository.Get().UpdateUserPoints(request); }
public async Task UpdateUser(string usuarioId, string email, string primaryTelephone, string secundaryTelephone, string cep) { await UserApiRepository.Get().UpdateUser(usuarioId, email, primaryTelephone, secundaryTelephone, cep); }
public async Task SendBirthdayEmail(string emailInvited, string nameUser) { await UserApiRepository.Get().SendBirthdayEmail(emailInvited, nameUser); }
public async Task SendEmail(string emailInvited, string nameInvited, string nameUser, string cpf, string telephone, string cep, string emailInviter) { await UserApiRepository.Get().SendEmail(emailInvited, nameInvited, nameUser, cpf, telephone, cep, emailInviter); }
public async Task ResetPassword(string usuarioId) { await UserApiRepository.Get().ResetPassword(usuarioId); }
public async Task Logout(string usuarioId) { await UserApiRepository.Get().Logout(usuarioId); }
public async Task <LoginReponse> Login(LoginRequest request) { return(await UserApiRepository.Get().Login(request)); }
public async Task <User> GetUserByEmail(string email) { return(await UserApiRepository.Get().GetUserByEmail(email)); }
public async Task <GetAppUsersResponse> GetAllAppUsers() { return(await UserApiRepository.Get().GetAllAppUsers()); }
public async Task ChangePassword(ChangePasswordRequest request) { await UserApiRepository.Get().ChangePassword(request); }