Exemple #1
0
        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());
        }
Exemple #2
0
        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
            });
        }
Exemple #3
0
 public async Task <int> GetUserInvitePointsForChallenge(string usuarioId)
 {
     return(await UserApiRepository.Get().GetUserInvitePointsForChallenge(usuarioId));
 }
Exemple #4
0
 public async Task UpdateUserPoints(UpdateUserPointsRequest request)
 {
     await UserApiRepository.Get().UpdateUserPoints(request);
 }
Exemple #5
0
 public async Task UpdateUser(string usuarioId, string email, string primaryTelephone, string secundaryTelephone, string cep)
 {
     await UserApiRepository.Get().UpdateUser(usuarioId, email, primaryTelephone, secundaryTelephone, cep);
 }
Exemple #6
0
 public async Task SendBirthdayEmail(string emailInvited, string nameUser)
 {
     await UserApiRepository.Get().SendBirthdayEmail(emailInvited, nameUser);
 }
Exemple #7
0
 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);
 }
Exemple #8
0
 public async Task ResetPassword(string usuarioId)
 {
     await UserApiRepository.Get().ResetPassword(usuarioId);
 }
Exemple #9
0
 public async Task Logout(string usuarioId)
 {
     await UserApiRepository.Get().Logout(usuarioId);
 }
Exemple #10
0
 public async Task <LoginReponse> Login(LoginRequest request)
 {
     return(await UserApiRepository.Get().Login(request));
 }
Exemple #11
0
 public async Task <User> GetUserByEmail(string email)
 {
     return(await UserApiRepository.Get().GetUserByEmail(email));
 }
Exemple #12
0
 public async Task <GetAppUsersResponse> GetAllAppUsers()
 {
     return(await UserApiRepository.Get().GetAllAppUsers());
 }
Exemple #13
0
 public async Task ChangePassword(ChangePasswordRequest request)
 {
     await UserApiRepository.Get().ChangePassword(request);
 }