Example #1
0
        public User Create(string username, string twitchId, string youTubeId, string password = null)
        {
            User user = gameData.CreateUser();

            user.TwitchId     = twitchId;
            user.YouTubeId    = youTubeId;
            user.Username     = username;
            user.PasswordHash = StringHasher.Get(password);
            return(user);
        }
Example #2
0
 public AuthResult Authenticate(User user, string password)
 {
     return(user?.PasswordHash == StringHasher.Get(password) ? AuthResult.Success : AuthResult.InvalidPassword);
 }