Genie.jl
Genie.jl copied to clipboard
Route to reach external URL
Is your feature request related to a problem? Please describe. I'm trying to use OAuth2 login but cannot setup my routes in a way that brings me to my authentication website
Describe the solution you'd like
route("/login", Genie.Renderer.redirect(:orcid_login))
The problem is route expects a reference to a function. When you pass Genie.Renderer.redirect(:orcid_login) you don't pass the function, you pass the result of executing the function, which is a HTTP.Response.
Try
route("/login") do
Genie.Renderer.redirect("<url_to_external_oauth_service_or_whatever_you_need>")
end
That works, thanks! I think the nuance that route expects a reference to a function is super important, and I didn't quite got this from the docs.