@@ -1343,13 +1343,12 @@ func (api *API) oauthLogin(r *http.Request, params *oauthLoginParams) ([]*http.C
1343
1343
if user .ID == uuid .Nil {
1344
1344
var organizationID uuid.UUID
1345
1345
//nolint:gocritic
1346
- organizations , _ := tx .GetOrganizations (dbauthz .AsSystemRestricted (ctx ))
1347
- if len (organizations ) > 0 {
1348
- // Add the user to the first organization. Once multi-organization
1349
- // support is added, we should enable a configuration map of user
1350
- // email to organization.
1351
- organizationID = organizations [0 ].ID
1352
- }
1346
+ organization , _ := tx .GetDefaultOrganization (dbauthz .AsSystemRestricted (ctx ))
1347
+
1348
+ // Add the user to the default organization.
1349
+ // Once multi-organization we should check some configuration to see
1350
+ // if we should add the user to a different organization.
1351
+ organizationID = organization .ID
1353
1352
1354
1353
//nolint:gocritic
1355
1354
_ , err := tx .GetUserByEmailOrUsername (dbauthz .AsSystemRestricted (ctx ), database.GetUserByEmailOrUsernameParams {
@@ -1395,7 +1394,7 @@ func (api *API) oauthLogin(r *http.Request, params *oauthLoginParams) ([]*http.C
1395
1394
// All of the userauth tests depend on this being able to create
1396
1395
// the first organization. It shouldn't be possible in normal
1397
1396
// operation.
1398
- CreateOrganization : len ( organizations ) == 0 ,
1397
+ CreateOrganization : organizationID == uuid . Nil ,
1399
1398
LoginType : params .LoginType ,
1400
1399
})
1401
1400
if err != nil {
0 commit comments