private void ValidateNewUser(SSAuthInterfaces.UserAuth user, string password) { user.ThrowIfNull("newUser"); password.ThrowIfNullOrEmpty("password"); if (user.UserName.IsNullOrEmpty() && user.Email.IsNullOrEmpty()) throw new ArgumentNullException("UserName or Email is required"); if (!user.UserName.IsNullOrEmpty()) { if (!ValidUserNameRegEx.IsMatch(user.UserName)) throw new ArgumentException("UserName contains invalid characters", "UserName"); } }
public void LoadUserAuth(SSAuthInterfaces.IAuthSession session, SSAuthInterfaces.IOAuthTokens tokens) { session.ThrowIfNull("session"); var userAuth = GetUserAuth(session, tokens); LoadUserAuth(session, userAuth); }