mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Add new Grist login page
Summary: Adds a new Grist login page to the login app, and replaces the server-side Cognito Google Sign-In flow with Google's own OAuth flow. Test Plan: Browser and server tests. Reviewers: jarek Reviewed By: jarek Differential Revision: https://phab.getgrist.com/D3332
This commit is contained in:
@@ -131,27 +131,6 @@ export class Hosts {
|
||||
return this._redirectHost.bind(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns true if `url` either points to a native Grist host (e.g. foo.getgrist.com),
|
||||
* or a custom host for an existing Grist org.
|
||||
*/
|
||||
public async isSafeRedirectUrl(url: string): Promise<boolean> {
|
||||
const {host, protocol} = new URL(url);
|
||||
if (!['http:', 'https:'].includes(protocol)) { return false; }
|
||||
|
||||
switch (this._getHostType(host)) {
|
||||
case 'native': { return true; }
|
||||
case 'custom': {
|
||||
const org = await mapGetOrSet(this._host2org, host, async () => {
|
||||
const o = await this._dbManager.connection.manager.findOne(Organization, {host});
|
||||
return o?.domain ?? undefined;
|
||||
});
|
||||
return org !== undefined;
|
||||
}
|
||||
default: { return false; }
|
||||
}
|
||||
}
|
||||
|
||||
public close() {
|
||||
this._host2org.clear();
|
||||
this._org2host.clear();
|
||||
|
||||
Reference in New Issue
Block a user