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:
@@ -1,8 +0,0 @@
|
||||
import env from "@server/env";
|
||||
|
||||
/**
|
||||
* True if the current installation is the cloud hosted version at getoutline.com
|
||||
*/
|
||||
const isCloudHosted = env.DEPLOYMENT === "hosted";
|
||||
|
||||
export default isCloudHosted;
|
||||
@@ -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 } });
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import env from "@server/env";
|
||||
|
||||
export const robotsResponse = () => {
|
||||
if (env.DEPLOYMENT === "hosted") {
|
||||
if (env.isCloudHosted()) {
|
||||
return `
|
||||
User-agent: *
|
||||
Allow: /
|
||||
|
||||
@@ -46,7 +46,7 @@ export function checkPendingMigrations() {
|
||||
}
|
||||
|
||||
export async function checkMigrations() {
|
||||
if (env.DEPLOYMENT === "hosted") {
|
||||
if (env.isCloudHosted()) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user