fix: Do not show actively disabled auth providers in self-hosted install (#4794)

* fix: Do not show actively disabled auth providers in self-hosted installation

* self review

* Refactor for easier mocking
This commit is contained in:
Tom Moor
2023-01-28 10:02:25 -08:00
committed by GitHub
parent aac495fa58
commit 075555a867
17 changed files with 95 additions and 62 deletions

View File

@@ -102,7 +102,7 @@ export async function getTeamFromContext(ctx: Context) {
const domain = parseDomain(host);
let team;
if (env.DEPLOYMENT !== "hosted") {
if (!env.isCloudHosted()) {
team = await Team.findOne();
} else if (domain.custom) {
team = await Team.findOne({ where: { domain: domain.host } });