feat: Enforce single team when self-hosted (#1954)

* fix: Enforce single team when self hosting

* test: positive case

* refactor

* fix: Visible error message on login screen for max teams scenario

* Update Notices.js

* lint
This commit is contained in:
Tom Moor
2021-03-18 21:56:24 -07:00
committed by GitHub
parent 138336639d
commit 1b972070d7
9 changed files with 101 additions and 8 deletions

View File

@@ -11,14 +11,14 @@ import {
} from "../errors";
import auth from "../middlewares/authentication";
import passportMiddleware from "../middlewares/passport";
import { getAllowedDomains } from "../utils/authentication";
import { StateStore } from "../utils/passport";
const router = new Router();
const providerName = "google";
const GOOGLE_CLIENT_ID = process.env.GOOGLE_CLIENT_ID;
const GOOGLE_CLIENT_SECRET = process.env.GOOGLE_CLIENT_SECRET;
const allowedDomainsEnv = process.env.GOOGLE_ALLOWED_DOMAINS;
const allowedDomains = allowedDomainsEnv ? allowedDomainsEnv.split(",") : [];
const allowedDomains = getAllowedDomains();
const scopes = [
"https://www.googleapis.com/auth/userinfo.profile",