struct MyAction
include Onyx::REST::Action
params do
query do
type redirect : Bool
end
end
before do
redirect("https://google.com") if params.query.redirect
end
end
Currently the callbacks.cr shard ignores the callbacks' return values.
Possible solutions:
Action#halt method and @halted : Bool = false variable. Action#call checks if the @halted is false before run
before do
halt(redirect("https://google.com")) if params.query.redirect
end
before do
puts "Will be put anyway"
end
But in this case further before callbacks are still run.
Currently the callbacks.cr shard ignores the callbacks' return values.
Possible solutions:
Action#haltmethod and@halted : Bool = falsevariable.Action#callchecks if the@haltedisfalsebefore runBut in this case further
beforecallbacks are still run.