Skip to content

Commit 83a649d

Browse files
committed
Defer adding users to the new users endpoint
1 parent 0355ab6 commit 83a649d

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

database/login.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,8 @@ func LoginUserToGPCM(pool *pgxpool.Pool, ctx context.Context, userId uint64, gsb
114114

115115
logging.Notice("DATABASE", "Created new GPCM user:", aurora.Cyan(userId), aurora.Cyan(gsbrcd), aurora.Cyan(user.ProfileId))
116116

117-
newUsers = append(newUsers, user)
117+
// Defer appending so the user is fully initialized (surely!)
118+
defer func() { newUsers = append(newUsers, user) }()
118119
} else {
119120
var firstName *string
120121
var lastName *string

0 commit comments

Comments
 (0)