internal IUser Register(IAccountRegistration creds) { // encrypt the password?? creds.Password = BCrypt.Net.BCrypt.HashPassword(creds.Password); //sql try { string Id = Guid.NewGuid().ToString(); int id = _db.ExecuteScalar <int>(@" INSERT INTO users (Id, Email, Password, Username) VALUES (@Id, @Email, @Password, @Username); SELECT LAST_INSERT_ID(); ", new { Id, creds.Email, creds.Password, creds.Username }); return(new User() { Id = Id, Username = creds.Username, Email = creds.Email }); } catch (MySqlException e) { throw e; } }
public RegisterController( IAccountRegistration registration, IAccountActivation activation, ICodeDistribution codeDistribution, ILogger <RegisterController> log ) { Registration = registration; Activation = activation; Code = codeDistribution; Log = log; }
public override IWebUser Register(IAccountRegistration creds) { var auth = _provider.Register(creds); if (auth == null) { throw new Exception("Invalid Credentials"); } var user = new WebUser(auth); user.SetClaims(); return(user); }
public IUser Register(IAccountRegistration creds) { return(_repo.Register(creds)); }
public virtual T Register(IAccountRegistration creds) { throw new NotImplementedException(); }