summaryrefslogtreecommitdiff
path: root/internal/processing/account/create.go
diff options
context:
space:
mode:
Diffstat (limited to 'internal/processing/account/create.go')
-rw-r--r--internal/processing/account/create.go9
1 files changed, 3 insertions, 6 deletions
diff --git a/internal/processing/account/create.go b/internal/processing/account/create.go
index 44d6bbea5..e6cb44ce8 100644
--- a/internal/processing/account/create.go
+++ b/internal/processing/account/create.go
@@ -22,21 +22,18 @@ import (
"context"
"fmt"
- "github.com/sirupsen/logrus"
-
"github.com/superseriousbusiness/gotosocial/internal/ap"
apimodel "github.com/superseriousbusiness/gotosocial/internal/api/model"
"github.com/superseriousbusiness/gotosocial/internal/config"
"github.com/superseriousbusiness/gotosocial/internal/gtserror"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
+ "github.com/superseriousbusiness/gotosocial/internal/log"
"github.com/superseriousbusiness/gotosocial/internal/messages"
"github.com/superseriousbusiness/gotosocial/internal/text"
"github.com/superseriousbusiness/oauth2/v4"
)
func (p *processor) Create(ctx context.Context, applicationToken oauth2.TokenInfo, application *gtsmodel.Application, form *apimodel.AccountCreateRequest) (*apimodel.Token, gtserror.WithCode) {
- l := logrus.WithField("func", "accountCreate")
-
emailAvailable, err := p.db.IsEmailAvailable(ctx, form.Email)
if err != nil {
return nil, gtserror.NewErrorBadRequest(err)
@@ -62,13 +59,13 @@ func (p *processor) Create(ctx context.Context, applicationToken oauth2.TokenInf
reason = ""
}
- l.Trace("creating new username and account")
+ log.Trace("creating new username and account")
user, err := p.db.NewSignup(ctx, form.Username, text.SanitizePlaintext(reason), approvalRequired, form.Email, form.Password, form.IP, form.Locale, application.ID, false, false)
if err != nil {
return nil, gtserror.NewErrorInternalError(fmt.Errorf("error creating new signup in the database: %s", err))
}
- l.Tracef("generating a token for user %s with account %s and application %s", user.ID, user.AccountID, application.ID)
+ log.Tracef("generating a token for user %s with account %s and application %s", user.ID, user.AccountID, application.ID)
accessToken, err := p.oauthServer.GenerateUserAccessToken(ctx, applicationToken, application.ClientSecret, user.ID)
if err != nil {
return nil, gtserror.NewErrorInternalError(fmt.Errorf("error creating new access token for user %s: %s", user.ID, err))