mirror of
https://github.com/h44z/wg-portal.git
synced 2025-12-18 20:26:18 +00:00
RESTful API for WireGuard Portal (#11)
This commit is contained in:
@@ -142,6 +142,7 @@ func (m Manager) GetOrCreateUserUnscoped(email string) (*User, error) {
|
||||
|
||||
func (m Manager) CreateUser(user *User) error {
|
||||
user.Email = strings.ToLower(user.Email)
|
||||
user.Source = UserSourceDatabase
|
||||
res := m.db.Create(user)
|
||||
if res.Error != nil {
|
||||
return errors.Wrapf(res.Error, "failed to create user %s", user.Email)
|
||||
|
||||
Reference in New Issue
Block a user