summaryrefslogtreecommitdiff
path: root/internal/api/client/account
diff options
context:
space:
mode:
Diffstat (limited to 'internal/api/client/account')
-rw-r--r--internal/api/client/account/account_test.go5
-rw-r--r--internal/api/client/account/accountcreate.go12
2 files changed, 8 insertions, 9 deletions
diff --git a/internal/api/client/account/account_test.go b/internal/api/client/account/account_test.go
index 5e1959cc2..02817984b 100644
--- a/internal/api/client/account/account_test.go
+++ b/internal/api/client/account/account_test.go
@@ -9,7 +9,6 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/federation"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
- "github.com/superseriousbusiness/gotosocial/internal/oauth"
"github.com/superseriousbusiness/gotosocial/internal/processing"
"github.com/superseriousbusiness/gotosocial/internal/typeutils"
)
@@ -27,8 +26,8 @@ type AccountStandardTestSuite struct {
processor processing.Processor
// standard suite models
- testTokens map[string]*oauth.Token
- testClients map[string]*oauth.Client
+ testTokens map[string]*gtsmodel.Token
+ testClients map[string]*gtsmodel.Client
testApplications map[string]*gtsmodel.Application
testUsers map[string]*gtsmodel.User
testAccounts map[string]*gtsmodel.Account
diff --git a/internal/api/client/account/accountcreate.go b/internal/api/client/account/accountcreate.go
index a9d672f80..3fab1488f 100644
--- a/internal/api/client/account/accountcreate.go
+++ b/internal/api/client/account/accountcreate.go
@@ -27,7 +27,7 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/api/model"
"github.com/superseriousbusiness/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/oauth"
- "github.com/superseriousbusiness/gotosocial/internal/util"
+ "github.com/superseriousbusiness/gotosocial/internal/validate"
)
// AccountCreatePOSTHandler swagger:operation POST /api/v1/accounts accountCreate
@@ -118,15 +118,15 @@ func validateCreateAccount(form *model.AccountCreateRequest, c *config.AccountsC
return errors.New("registration is not open for this server")
}
- if err := util.ValidateUsername(form.Username); err != nil {
+ if err := validate.Username(form.Username); err != nil {
return err
}
- if err := util.ValidateEmail(form.Email); err != nil {
+ if err := validate.Email(form.Email); err != nil {
return err
}
- if err := util.ValidateNewPassword(form.Password); err != nil {
+ if err := validate.NewPassword(form.Password); err != nil {
return err
}
@@ -134,11 +134,11 @@ func validateCreateAccount(form *model.AccountCreateRequest, c *config.AccountsC
return errors.New("agreement to terms and conditions not given")
}
- if err := util.ValidateLanguage(form.Locale); err != nil {
+ if err := validate.Language(form.Locale); err != nil {
return err
}
- if err := util.ValidateSignUpReason(form.Reason, c.ReasonRequired); err != nil {
+ if err := validate.SignUpReason(form.Reason, c.ReasonRequired); err != nil {
return err
}