gristlabs / grist-core

Grist is the evolution of spreadsheets.

Home Page:https://www.getgrist.com/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Grist Forms - Redirecting loop error

s-karrer opened this issue · comments

Hello, i am working with Grist Forms and found a bug when i want to access a published form.

Problem

I get a redirecting loop error accessing the forms link : http://localhost:9999/forms/47QFRwq6wLjhGTYaUAckWG/4

image

This bug came up when using Grist Omnibus with email/password authentication and you have a logged in session.
(Grist Version 1.1.13)

The log output:

2024-05-06 07:20:27.067 - debug: Authorizer: redirecting to log in
2024-05-06 07:20:27.095 - debug: Authorizer: redirecting to log in
2024-05-06 07:20:27.119 - debug: Authorizer: redirecting to log in
2024-05-06 07:20:27.155 - debug: Authorizer: redirecting to log in
2024-05-06 07:20:27.209 - debug: Authorizer: redirecting to log in
2024-05-06 07:20:27.251 - debug: Authorizer: redirecting to log in
2024-05-06 07:20:27.288 - debug: Authorizer: redirecting to log in
2024-05-06 07:20:27.319 - debug: Authorizer: redirecting to log in
2024-05-06 07:20:27.350 - debug: Authorizer: redirecting to log in
2024-05-06 07:20:27.378 - debug: Authorizer: redirecting to log in

Solution

I figured out that the formMiddleware is missing some redirects as you can see here:

formMiddleware: [
forcedLoginMiddleware,
],

When adding the redirects used for docMiddleware, it is working fine:

formMiddleware: [
        this._redirectToHostMiddleware,
        this._userIdMiddleware,
        forcedLoginMiddleware,
        this._redirectToOrgMiddleware,
        welcomeNewUser
      ],

If I use Grist only instead of Grist Omnibus it is working but I dont know why maybe because no authentication and redirect is happening. Also the form access link is different: http://localhost:8484/o/docs/forms/5jzQzr3NL8tYwALbBcJkBz/4

I am not into that code base so maybe someone can have a closer look.
Is this fix valid or do i miss something and the fix should be in my Omnibus setup?