~bigbes/core-go

64b8e7410b630b033f549e6fb9eeb8ea36c4ff94 — Drew DeVault 1 year, 9 months ago 9e4ef2d
auth/middleware: fix user_type on new users
1 files changed, 3 insertions(+), 3 deletions(-)

M auth/middleware.go
M auth/middleware.go => auth/middleware.go +3 -3
@@ 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,