Exemplo n.º 1
0
        public static async Task <Tuple <Users, string> > ValidateCredentials(TestAppEntities ctx, string Email, string Password)
        {
            try
            {
                string message    = String.Empty;
                var    user_found = await Users.GetItem(ctx, Email);

                if (user_found != null)
                {
                    if (user_found.is_active == true)
                    {
                        if (user_found.password == Password)
                        {
                        }
                        else
                        {
                            message = "Email or password incorrect.";
                        }
                    }
                    else
                    {
                        message = "User inactive.";
                    }
                }
                else
                {
                    message = "Email or password incorrect.";
                }


                return(Tuple.Create(user_found, message));
            }
            catch (Exception ex)
            {
                throw ex;
            }
        }
Exemplo n.º 2
0
 public UsersController(TestAppEntities ctx)
 {
     _ctx = ctx;
 }
Exemplo n.º 3
0
 public CustomFilesController(TestAppEntities ctx, IWebHostEnvironment hostingEnvironment)
 {
     _ctx = ctx;
     _hostingEnvironment = hostingEnvironment;
 }
Exemplo n.º 4
0
 public SessionController(TestAppEntities ctx)
 {
     _ctx = ctx;
 }
Exemplo n.º 5
0
 public Cars_MarioController(TestAppEntities context)
 {
     _context = context;
 }
Exemplo n.º 6
0
 public PersonsController(TestAppEntities ctx)
 {
     _ctx = ctx;
 }