digitallyinduced/ihp-forum

Bad gateway error on login

zarak opened this issue ยท 4 comments

zarak commented

As a logged out user, I clicked on the new comment button and was taken to the log-in page. When I entered my login information, I received a 502 Bad Gateway error. When I navigated back to the website, however, I was successfully logged in.

zarak commented

This is the error I get in dev:

("SELECT users.* FROM users WHERE email = ?  LIMIT 1",[Escape "test@test.com"])
POST /CreateSession
  Params: [("email","test@test.com"),("password","<removed>"),("null","")]
  Request Body: email=test%40test.com&password=<removed>&null=
  Accept: */*
  Status: 302 Found 0.112397633s
("SELECT users.* FROM users WHERE id = ?  LIMIT 1",[Plain "'a7414722-ca03-4a81-b676-eecf9a063e20'"])
GET /NewComment
  Accept: */*
  Status: 500 Internal Server Error 0.001048655s
AutoRoute: Param missing
CallStack (from HasCallStack):
  error, called at ./IHP/RouterSupport.hs:126:111 in ihp-0.1.0.0-BkpffE8tq5UEYAWij1jGE2-IHPFramework:IHP.RouterSupport
AutoRoute: Param missing
CallStack (from HasCallStack):
  error, called at ./IHP/RouterSupport.hs:126:111 in ihp-0.1.0.0-BkpffE8tq5UEYAWij1jGE2-IHPFramework:IHP.RouterSupport
("SELECT users.* FROM users WHERE id = ?  LIMIT 1",[Plain "'a7414722-ca03-4a81-b676-eecf9a063e20'"])
AutoRoute: Param missing
CallStack (from HasCallStack):
  error, called at ./IHP/RouterSupport.hs:126:111 in ihp-0.1.0.0-BkpffE8tq5UEYAWij1jGE2-IHPFramework:IHP.RouterSupport

Thanks for reporting ๐Ÿ‘

It seems like the request query params are missing when the sessions controller is doing the redirect after login.

The url is saved to the session here: https://github.com/digitallyinduced/ihp/blob/master/IHP/LoginSupport/Helper/Controller.hs#L101 It think there the call to getRequestUrl will not pass the query arguments. Will take a closer look in a few minutes.

Just pushed a fix to IHP. We just need to update the IHP version of ihp-forum once this is merged into master.

With the latest deployment we're now running the latest IHP version again, so this should be fixed :)