-
-
Notifications
You must be signed in to change notification settings - Fork 158
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
Flash messages are not maintained with multiple redirects. #1162
Comments
Ok, I've located the issue and found an easy fix but before I make a PR, I would like to discuss the changes. Let's say we have the following setup:
The module Lucky::Redirectable
# ...
def redirect(to path : String, status : Int32 = 302) : Lucky::TextResponse
flash.recycle
# ...
end
# ...
end Its functionality would be: class Lucky::FlashStore
# ...
def recycle : Void
@next = @now
end
# ...
end What do you think? |
I had the same issue myself. Good catch @wout! I think that sounds good, but maybe some setting/param to disable the flash on redirect if you want to for some reason. |
@confact I've also been thinking about that. But if you don't want the flash messages to be recycled, you could always explicitly class Home::Index < BrowserAction
get "/home" do
flash.clear
redirect Dashboard::Index
end
end I found that to be convenient enough. :) |
A yeah. That's even better :) |
Love it! I think The only suggestion I have (which shouldn't stop a PR) is to call it |
In continuation of #1160.
The text was updated successfully, but these errors were encountered: