Browse Source

secure note routes

main
Inhji Y. 10 months ago
parent
commit
0c1600fd07
  1. 4
      lib/mirage_web/controllers/note_controller.ex

4
lib/mirage_web/controllers/note_controller.ex

@ -4,6 +4,10 @@ defmodule MirageWeb.NoteController do
alias Mirage.Notes
alias Mirage.Notes.Note
import MirageWeb.UserAuth, only: [require_authenticated_user: 2]
plug :require_authenticated_user when action in [:new, :edit, :update, :delete]
def index(conn, _params) do
notes = Notes.list_notes()
render(conn, "index.html", notes: notes)

Loading…
Cancel
Save