summaryrefslogtreecommitdiff
path: root/internal/api/client/auth/callback.go
diff options
context:
space:
mode:
authorLibravatar tsmethurst <tobi.smethurst@klarrio.com>2021-09-01 18:29:25 +0200
committerLibravatar tsmethurst <tobi.smethurst@klarrio.com>2021-09-01 18:29:25 +0200
commit4696e1a7b389599fa981f334b343daa911b11f5d (patch)
treed1ca0c896cdacb82ad7c64ee150aa32b37d4c053 /internal/api/client/auth/callback.go
parentmove oauth models into gtsmodel (diff)
downloadgotosocial-4696e1a7b389599fa981f334b343daa911b11f5d.tar.xz
moving stuff around
Diffstat (limited to 'internal/api/client/auth/callback.go')
-rw-r--r--internal/api/client/auth/callback.go6
1 files changed, 3 insertions, 3 deletions
diff --git a/internal/api/client/auth/callback.go b/internal/api/client/auth/callback.go
index c2fbfb486..322ba5fc9 100644
--- a/internal/api/client/auth/callback.go
+++ b/internal/api/client/auth/callback.go
@@ -33,7 +33,7 @@ import (
"github.com/superseriousbusiness/gotosocial/internal/db"
"github.com/superseriousbusiness/gotosocial/internal/gtsmodel"
"github.com/superseriousbusiness/gotosocial/internal/oidc"
- "github.com/superseriousbusiness/gotosocial/internal/util"
+ "github.com/superseriousbusiness/gotosocial/internal/validate"
)
// CallbackGETHandler parses a token from an external auth provider.
@@ -153,7 +153,7 @@ func (m *Module) parseUserFromClaims(ctx context.Context, claims *oidc.Claims, i
}
// check if we can just use claims.Name as-is
- err = util.ValidateUsername(claims.Name)
+ err = validate.Username(claims.Name)
if err == nil {
// the name we have on the claims is already a valid username
username = claims.Name
@@ -166,7 +166,7 @@ func (m *Module) parseUserFromClaims(ctx context.Context, claims *oidc.Claims, i
// lowercase the whole thing
lower := strings.ToLower(underscored)
// see if this is valid....
- if err := util.ValidateUsername(lower); err == nil {
+ if err := validate.Username(lower); err == nil {
// we managed to get a valid username
username = lower
} else {