-
-
Notifications
You must be signed in to change notification settings - Fork 110
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Errors on redirect #99
Comments
Hello @mvader Thanks for opening this ticket. Are you using this framework alone, or with |
I'm using it with lotusrb. —Reply to this email directly or view it on GitHub. |
@mvader Which kind of error do you get? Is this related to hanami/hanami#196 ? Can you please post the stack trace here? Thank you. |
I don't get any error. It just doesn't work as expected. I've been able to reproduce even with the fix you mentioned in #196. Just setup an application with cookies and the session like that: cookies true
sessions :cookie, secret: ENV['WEB_SESSIONS_SECRET'] Once you've submitted a form with errors, on every other request the retrieved errors via the As I said, two cookies are set, maybe that's the problem. I implemented the sessions and cookies myself using Rack::Session and it worked. With Rack::Session only one cookie was set. New action: module Web::Controllers::Foo
class New
include Web::Action
def call(params)
puts errors.inspect?
end
end
end Create action: module Web::Controllers::Foo
class Create
include Web::Action
params do
param :title, presence: true, size: 3..255
end
def call(params)
if !params.valid?
# foo
else
# foo
end
end
end
end |
Closing because I think it was fixed by #100 |
Hi,
I've been trying to get the errors of the previous action after a redirect (which I've seen it's possible according to lotus/controller code) but I can't. I've also been searching for examples on how to do this right but I found nothing.
I have this on my controller config:
On my action after the redirect I have this:
The first time I submit my form everything is ok, I get the errors on the action after the redirect. But if I submit the form more times I get the same errors as the first time no matter what the input contents are.
I've also noticed that two cookies "rack.session" are set. One with the path "/" and one with the path "/foo" where /foo is the endpoint of the form action. Maybe it has something to do with that.
The text was updated successfully, but these errors were encountered: