mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
(core) Fix WelcomePage to use an explicit action URL, and parse submitted body in time to log it with errors.
Test Plan: Tested manually that "Preflight" error goes away in Safari. Reviewers: paulfitz Reviewed By: paulfitz Differential Revision: https://phab.getgrist.com/D2644
This commit is contained in:
@@ -972,6 +972,10 @@ export class FlexServer implements GristServer {
|
||||
let body: string|undefined;
|
||||
let permitKey: string|undefined;
|
||||
try {
|
||||
const user = getUser(req);
|
||||
const row = {...req.body, UserID: userId, Name: user.name, Email: user.loginEmail};
|
||||
body = JSON.stringify(mapValues(row, value => [value]));
|
||||
|
||||
// Take an extra step to translate the special urlId to a docId. This is helpful to
|
||||
// allow the same urlId to be used in production and in test. We need the docId for the
|
||||
// specialPermit below, which we need to be able to write to this doc.
|
||||
@@ -985,10 +989,6 @@ export class FlexServer implements GristServer {
|
||||
throw new Error(`Can't resolve ${urlId}: ${docAuth.error}`);
|
||||
}
|
||||
|
||||
const user = getUser(req);
|
||||
const row = {...req.body, UserID: userId, Name: user.name, Email: user.loginEmail};
|
||||
body = JSON.stringify(mapValues(row, value => [value]));
|
||||
|
||||
permitKey = await this._docWorkerMap.setPermit({docId});
|
||||
const res = await fetch(await this.getHomeUrlByDocId(docId, `/api/docs/${docId}/tables/Responses/data`), {
|
||||
method: 'POST',
|
||||
|
||||
Reference in New Issue
Block a user