I am trying to get the current logged in user id in controller as i am using pow authentication and plugs for authentication this same method is working on front-end view but getting errors when i use in controller
def create_individual(attrs \ %{}) do
user = Pow.Plug.current_user(@conn)
attrs = Map.put(attrs, “user_id”, user.id)
%Individual{}
|> Individual.changeset(attrs)
|> Repo.insert()
end
Error: no function clause matching in Pow.Plug.fetch_config/1