MastodonAPI: Add sign out.

Close #79
This commit is contained in:
Roger Braun 2017-11-19 13:23:16 +01:00
parent 40ca379357
commit 0f099dac67
2 changed files with 11 additions and 4 deletions

View File

@ -583,6 +583,12 @@ def login_post(conn, %{"authorization" => %{ "name" => name, "password" => passw
end
end
def logout(conn, _) do
conn
|> clear_session
|> redirect(to: "/")
end
def relationship_noop(%{assigns: %{user: user}} = conn, %{"id" => id}) do
Logger.debug("Unimplemented, returning unmodified relationship")
with %User{} = target <- Repo.get(User, id) do

View File

@ -223,12 +223,13 @@ def user_fetcher(username) do
get "/webfinger", WebFinger.WebFingerController, :webfinger
end
scope "/web", Pleroma.Web.MastodonAPI do
scope "/", Pleroma.Web.MastodonAPI do
pipe_through :mastodon_html
get "/login", MastodonAPIController, :login
post "/login", MastodonAPIController, :login_post
get "/*path", MastodonAPIController, :index
get "/web/login", MastodonAPIController, :login
post "/web/login", MastodonAPIController, :login_post
get "/web/*path", MastodonAPIController, :index
delete "/auth/sign_out", MastodonAPIController, :logout
end
scope "/", Fallback do