Skip to content

Commit

Permalink
Update subdomain existence check. (#4662)
Browse files Browse the repository at this point in the history
  • Loading branch information
vadimberezniker authored Aug 28, 2023
1 parent bee210b commit 3c7d514
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
14 changes: 8 additions & 6 deletions app/router/router.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -368,12 +368,14 @@ class Router {
// Require the user to create an org if they are logged in but not part of
// an org.
if (user && !user.groups?.length) {
if (capabilities.config.customerSubdomain) {
const params = new URLSearchParams({ source_url: window.location.href });
return Path.orgAccessDeniedPath + "?" + params.toString();
} else {
return Path.createOrgPath;
}
return Path.createOrgPath;
}

// No selected group on subdomain means either the group doesn't exist or
// the user does not have access to it.
if (user && !user.selectedGroup.id && capabilities.config.customerSubdomain) {
const params = new URLSearchParams({ source_url: window.location.href });
return Path.orgAccessDeniedPath + "?" + params.toString();
}

const path = window.location.pathname;
Expand Down
1 change: 1 addition & 0 deletions server/buildbuddy_server/buildbuddy_server.go
Original file line number Diff line number Diff line change
Expand Up @@ -826,6 +826,7 @@ func selectedGroup(ctx context.Context, preferredGroupID string, groupRoles []*t
return gr
}
}
return nil
}
if preferredGroupID != "" {
for _, gr := range groupRoles {
Expand Down

0 comments on commit 3c7d514

Please sign in to comment.