GenieAuthentication.jl icon indicating copy to clipboard operation
GenieAuthentication.jl copied to clipboard

How to access current_user in side custom controller?

Open MontyTHall opened this issue 1 year ago • 0 comments

I can't do this:

module AdminController

using GenieAuthentication, Genie.Renderer, Genie.Exceptions, Genie.Renderer.Html

function index()
  authenticated!()

#  h1("Welcome Admin") |> html
   current_user().name
end

end

But in a routes.jl file I can do this

route("/auth") do
    current_user().name
end

MontyTHall avatar Mar 06 '23 02:03 MontyTHall