mirror of
https://github.com/mgerb/classic-wow-forums
synced 2026-01-10 17:12:48 +00:00
thread update/insert changeset fixed - auth permissions done
This commit is contained in:
@@ -1,13 +1,21 @@
|
||||
defmodule MyAppWeb.Router do
|
||||
use MyAppWeb, :router
|
||||
alias MyApp.Guardian.AuthPipeline
|
||||
alias MyApp.Guardian.Auth
|
||||
|
||||
pipeline :api do
|
||||
plug :accepts, ["json"]
|
||||
end
|
||||
|
||||
pipeline :api_auth do
|
||||
plug AuthPipeline.JSON
|
||||
pipeline :user_auth do
|
||||
plug Auth.Pipeline.User
|
||||
end
|
||||
|
||||
pipeline :mod_auth do
|
||||
plug Auth.Pipeline.Mod
|
||||
end
|
||||
|
||||
pipeline :admin_auth do
|
||||
plug Auth.Pipeline.Admin
|
||||
end
|
||||
|
||||
# Other scopes may use custom stacks.
|
||||
@@ -17,26 +25,26 @@ defmodule MyAppWeb.Router do
|
||||
scope "/battlenet" do
|
||||
get "/authorize", BattleNetController, :authorize
|
||||
|
||||
pipe_through [:api_auth]
|
||||
pipe_through [:user_auth]
|
||||
get "/characters", BattleNetController, :characters
|
||||
end
|
||||
|
||||
scope "/user" do
|
||||
# authenticated routes
|
||||
pipe_through [:api_auth]
|
||||
pipe_through [:user_auth]
|
||||
get "/", UserController, :index
|
||||
end
|
||||
|
||||
scope "/thread" do
|
||||
# authenticated routes
|
||||
pipe_through [:api_auth]
|
||||
pipe_through [:user_auth]
|
||||
post "/", ThreadController, :insert
|
||||
put "/", ThreadController, :update
|
||||
end
|
||||
|
||||
scope "reply" do
|
||||
scope "/reply" do
|
||||
# authenticated routes
|
||||
pipe_through [:api_auth]
|
||||
pipe_through [:user_auth]
|
||||
post "/", ReplyController, :insert
|
||||
end
|
||||
|
||||
|
||||
Reference in New Issue
Block a user