From 64b8e7410b630b033f549e6fb9eeb8ea36c4ff94 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Fri, 15 Nov 2024 16:25:23 +0100 Subject: [PATCH] auth/middleware: fix user_type on new users --- auth/middleware.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/auth/middleware.go b/auth/middleware.go index 0aa3ca5ab447713511957eb6231c6a6df1995004..9def293e462b1b55a7dc7369a327a49763f8ebab 100644 --- a/auth/middleware.go +++ b/auth/middleware.go @@ -372,7 +372,6 @@ func FetchMetaProfile(ctx context.Context, username string, user *AuthContext) e profile := result.Me return database.WithTx(ctx, nil, func(tx *sql.Tx) error { // TODO: Make the database representation consistent with this - ut := strings.ToLower(profile.UserType) row := tx.QueryRowContext(ctx, ` INSERT INTO "user" ( created, @@ -403,8 +402,9 @@ func FetchMetaProfile(ctx context.Context, username string, user *AuthContext) e location, bio, suspension_notice;`, - profile.ID, profile.Username, profile.Email, ut, profile.URL, - profile.Location, profile.Bio, profile.SuspensionNotice) + profile.ID, profile.Username, profile.Email, + profile.UserType, profile.URL, profile.Location, + profile.Bio, profile.SuspensionNotice) // TODO: Register webhooks if err := row.Scan(&user.UserID, &user.Created, &user.Updated,