Exemple #1
0
        public override IWebUser Login(IAccountLogin creds)
        {
            var auth = _provider.Login(creds);

            if (auth == null)
            {
                throw new Exception("Invalid Credentials");
            }
            var user = new WebUser(auth);

            user.SetClaims();
            return(user);
        }
        internal IUser Login(IAccountLogin creds)
        {
            // more sql
            Account account = _db.QueryFirstOrDefault <Account>(@"
                SELECT * FROM users WHERE email = @Email
            ", creds);

            if (account != null)
            {
                var valid = BCrypt.Net.BCrypt.Verify(creds.Password, account.Password);
                if (valid)
                {
                    return(account.GetUser());
                }
            }
            return(null);
        }
Exemple #3
0
 public IUser Login(IAccountLogin creds)
 {
     return(_repo.Login(creds));
 }
Exemple #4
0
 public virtual T Login(IAccountLogin creds)
 {
     throw new NotImplementedException();
 }