architex/lib/matrix_server_web/router.ex

35 lines
769 B
Elixir
Raw Normal View History

2021-06-22 12:09:25 +00:00
defmodule MatrixServerWeb.Router do
use MatrixServerWeb, :router
2021-06-25 23:14:09 +00:00
alias MatrixServerWeb.Plug.Authenticate
pipeline :public do
2021-06-22 12:09:25 +00:00
plug :accepts, ["json"]
end
pipeline :authenticated do
plug :accepts, ["json"]
2021-06-25 23:14:09 +00:00
plug Authenticate
end
scope "/_matrix", MatrixServerWeb do
pipe_through :public
scope "/client/r0", as: :client do
post "/register", AuthController, :register
get "/login", AuthController, :login
get "/register/available", AccountController, :available
end
get "/client/versions", InfoController, :versions
2021-06-22 12:09:25 +00:00
end
scope "/_matrix", MatrixServerWeb do
pipe_through :authenticated
scope "/client/r0", as: :client do
get "/account/whoami", AccountController, :whoami
end
end
2021-06-22 12:09:25 +00:00
end