Beispiel #1
0
        private void Login()
        {
            var authenticator = new Authenticator();
            var session = authenticator.Authenticate(_email, _password);

            if (session.Authenticated())
            {
                // Present another view controller (MISSING IMPLEMENTATION)
            }
            else {
                // Reset password and display message
                _view.SetPasswordText("");
                _view.DisplayAlert("Invalid username or password", "Please try again.");
            }
        }
Beispiel #2
0
        static void AuthenticatorDatabase_InterationTest()
        {
            // get input from user
            Console.WriteLine("Authenticator-Database Integration Test");
            Console.WriteLine("Enter email");
            var email = Console.ReadLine();
            Console.WriteLine("Enter password");
            var password = Console.ReadLine();

            // authenticate
            var authenticator = new Authenticator();
            var session = authenticator.Authenticate(email, password);

            // output result
            Console.WriteLine(session.Authenticated() ? "User authenticated!" : "Invalid email or password.");
        }