2021-08-17 15:22:30 +00:00
|
|
|
import { GristLoginMiddleware, GristServer } from 'app/server/lib/GristServer';
|
|
|
|
import { getMinimalLoginMiddleware } from 'app/server/lib/MinimalLogin';
|
|
|
|
import { getSamlLoginMiddleware } from 'app/server/lib/SamlConfig';
|
2020-07-21 13:20:51 +00:00
|
|
|
|
2021-08-16 15:11:17 +00:00
|
|
|
export async function getLoginMiddleware(gristServer: GristServer): Promise<GristLoginMiddleware> {
|
|
|
|
const saml = await getSamlLoginMiddleware(gristServer);
|
|
|
|
if (saml) { return saml; }
|
2021-08-17 15:22:30 +00:00
|
|
|
return getMinimalLoginMiddleware(gristServer);
|
2020-07-21 13:20:51 +00:00
|
|
|
}
|