mirror of
https://github.com/gristlabs/grist-core.git
synced 2024-10-27 20:44:07 +00:00
54beaede84
Summary: SAML support had broken due to SameSite changes in browsers. This makes it work again, and tests it against Auth0 (now owned by Okta). Logging in and out works. The logged out state is confusing, and may not be complete. The "Add Account" menu item doesn't work. But with this, an important part of self-hosting becomes easier. SAML support works also in grist-core, for site pages, but there is a glitch on document pages that I'll look into separately. Test Plan: tested manually Reviewers: dsagal Reviewed By: dsagal Differential Revision: https://phab.getgrist.com/D2976
14 lines
636 B
TypeScript
14 lines
636 B
TypeScript
import {GristLoginMiddleware, GristServer} from 'app/server/lib/GristServer';
|
|
import {getSamlLoginMiddleware} from 'app/server/lib/SamlConfig';
|
|
|
|
export async function getLoginMiddleware(gristServer: GristServer): Promise<GristLoginMiddleware> {
|
|
const saml = await getSamlLoginMiddleware(gristServer);
|
|
if (saml) { return saml; }
|
|
return {
|
|
async getLoginRedirectUrl() { throw new Error('logins not implemented'); },
|
|
async getLogoutRedirectUrl() { throw new Error('logins not implemented'); },
|
|
async getSignUpRedirectUrl() { throw new Error('logins not implemented'); },
|
|
addEndpoints() { return "no-logins"; }
|
|
};
|
|
}
|