So I have a plug that checks if you are authed before you go about your business.
def authenticated?(conn, _opts) do
if conn.assigns.current_user do
conn
else
conn
|> put_flash(:error, "You must be logged in to access that page")
|> redirect(to: Helpers.session_path(conn, :new))
|> halt()
end
end
The conn
has a request_path
of say “/foo/bar”
Whats the best way to later look up that request_path
after I did the redirect so that way I can send whom ever back on the correct path after they have logged in?
I guess I could shove it in a session var? and look it up later to see if there was one.