mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Google auth endpoint has not responded with auth code
Summary: Google Auth popup wasn't able to resolve origin from gristConfig. Moving this reponsability to server side, where it gets calculated from initial request. Test Plan: n/a Reviewers: dsagal, paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2935
This commit is contained in:
@@ -51,12 +51,10 @@ export function makeGristConfig(homeUrl: string|null, extra: Partial<GristLoadCo
|
||||
* Primary used for Google Auth Grist's endpoint, but can be used in future in any other server side
|
||||
* authentication flow.
|
||||
*/
|
||||
export function makeMessagePage(server: GristServer, staticDir: string) {
|
||||
export function makeMessagePage(staticDir: string) {
|
||||
return async (req: express.Request, resp: express.Response, message: any) => {
|
||||
const config = server.getGristConfig();
|
||||
const fileContent = await fse.readFile(path.join(staticDir, "message.html"), 'utf8');
|
||||
const content = fileContent
|
||||
.replace("<!-- INSERT CONFIG -->", `<script>window.gristConfig = ${JSON.stringify(config)};</script>`)
|
||||
.replace("<!-- INSERT MESSAGE -->", `<script>window.message = ${JSON.stringify(message)};</script>`);
|
||||
resp.status(200).type('html').send(content);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user