Example #1
0
        public IGenericErrorHandler <string> LoginUserIn(string username, string password)
        {
            var errors = new GenericErrorHandler <string>();

            // Check the username and password are correct. Return a generic error no matter which one is incorrect
            if (!CredentialsValid(username, password))
            {
                errors.AddError("The username or password is incorrect");
                return(errors);
            }

            errors.Result = GenerateAuthenticationToken(username);

            return(errors);
        }