GenieFramework / GenieAuthentication.jl

Authentication plugin for Genie framework
MIT License
20 stars 11 forks source link

How to access current_user in side custom controller? #21

Open MontyTHall opened 1 year ago

MontyTHall commented 1 year ago

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