<commit_before>defmodule NoteItWeb.Router do
  use NoteItWeb.Web, :router

  pipeline :browser do
    plug :accepts, ["html"]
    plug :fetch_session
    plug :fetch_flash
    plug :protect_from_forgery
    plug :put_secure_browser_headers
  end

  pipeline :authenticate do
    plug :accepts, ["html"]
    plug :fetch_session
    plug :fetch_flash
    plug :protect_from_forgery
    plug :put_secure_browser_headers
    plug NoteItWeb.Plugs.AuthenticatePlug
  end

  pipeline :api do
    plug :accepts, ["json"]
  end

  scope "/", NoteItWeb do
    pipe_through :browser # Use the default browser stack

    get "/", PageController, :index
    get "/signup", SignupController, :index
    post "/signup", SignupController, :signup

    get "/login", LoginController, :index
    post "/login", LoginController, :login

    get "/groups", GroupController, :list # list groups the user belongs to_
    get "/groups/create", GroupController, :create
    post "/groups/create", GroupController, :add
    get "/groups/invite", GroupController, :invite
    post "/groups/invite", GroupController, :add_members
    get "/groups/g/:name", GroupController, :details

    get "/notes", NoteController, :list # list notes from all groups the user belongs to
    #get "/notes/my", NoteController, :list_mine
    #get "/notes/create", NoteController, :create
    get "/notes/:id", NoteController, :show
    post "/notes/:id", NoteController, :update
    # get "/notes/:id/delete", NoteController, :delete
  end

  scope "/", NoteItWeb do
    pipe_through :authenticate

    get "/password", PasswordController, :index
    post "/password", PasswordController, :change

    get "/logout", LoginController, :logout
  end

  # Other scopes may use custom stacks.
  # scope "/api", NoteItWeb do
  #   pipe_through :api
  # end
end
<commit_msg>moving groups endpoints(paths) to the authenticate pipeline<commit_after>defmodule NoteItWeb.Router do
  use NoteItWeb.Web, :router

  pipeline :browser do
    plug :accepts, ["html"]
    plug :fetch_session
    plug :fetch_flash
    plug :protect_from_forgery
    plug :put_secure_browser_headers
  end

  pipeline :authenticate do
    plug :accepts, ["html"]
    plug :fetch_session
    plug :fetch_flash
    plug :protect_from_forgery
    plug :put_secure_browser_headers
    plug NoteItWeb.Plugs.AuthenticatePlug
  end

  pipeline :api do
    plug :accepts, ["json"]
  end

  scope "/", NoteItWeb do
    pipe_through :browser # Use the default browser stack

    get "/", PageController, :index
    get "/signup", SignupController, :index
    post "/signup", SignupController, :signup

    get "/login", LoginController, :index
    post "/login", LoginController, :login

    get "/notes", NoteController, :list # list notes from all groups the user belongs to
    #get "/notes/my", NoteController, :list_mine
    #get "/notes/create", NoteController, :create
    get "/notes/:id", NoteController, :show
    post "/notes/:id", NoteController, :update
    # get "/notes/:id/delete", NoteController, :delete
  end

  scope "/", NoteItWeb do
    pipe_through :authenticate

    get "/password", PasswordController, :index
    post "/password", PasswordController, :change

    get "/logout", LoginController, :logout

    get "/groups", GroupController, :list # list groups the user belongs to_
    get "/groups/create", GroupController, :create
    post "/groups/create", GroupController, :add
    get "/groups/invite", GroupController, :invite
    post "/groups/invite", GroupController, :add_members
    get "/groups/g/:name", GroupController, :details

  end

  # Other scopes may use custom stacks.
  # scope "/api", NoteItWeb do
  #   pipe_through :api
  # end
end

{'fraction_non_alphanumeric': 0.10873681363267514, 'fraction_numerical': 0.0, 'mean_word_length': 3.565432098765432, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '99304', 'n_tokens_mistral': 1115, 'n_tokens_neox': 1084, 'n_words': 346}