fix: Self-hosted should show signin options for all configured authentication methods (#2986)

This commit is contained in:
Tom Moor
2022-06-04 10:46:03 -07:00
committed by GitHub
parent 4eb3b61c7a
commit 28439d315d
6 changed files with 205 additions and 110 deletions

View File

@@ -22,6 +22,7 @@ function filterProviders(team?: Team) {
return (
!team ||
env.DEPLOYMENT !== "hosted" ||
find(team.authenticationProviders, {
name: provider.id,
enabled: true,
@@ -40,10 +41,9 @@ router.post("auth.config", async (ctx) => {
// brand for the knowledge base and it's guest signin option is used for the
// root login page.
if (env.DEPLOYMENT !== "hosted") {
const teams = await Team.scope("withAuthenticationProviders").findAll();
const team = await Team.scope("withAuthenticationProviders").findOne();
if (teams.length === 1) {
const team = teams[0];
if (team) {
ctx.body = {
data: {
name: team.name,