Commit 8be01540 authored by kaniini's avatar kaniini
Browse files

Merge branch 'fix/access-mastofe-auth-on-private-instances' into 'develop'

Redirect not logged-in users to the MastoFE login page on private instances

Closes #1045

See merge request !1503
parents 1f7c8d96 c0e258cf
Pipeline #15386 failed with stages
in 42 minutes and 42 seconds
......@@ -28,6 +28,7 @@ The format is based on [Keep a Changelog](
- Rich Media: The crawled URL is now spliced into the rich media data.
- ActivityPub S2S: sharedInbox usage has been mostly aligned with the rules in the AP specification.
- ActivityPub S2S: remote user deletions now work the same as local user deletions.
- Not being able to access the Mastodon FE login page on private instances
### Added
- MRF: Support for priming the mediaproxy cache (`Pleroma.Web.ActivityPub.MRF.MediaProxyWarmingPolicy`)
......@@ -698,7 +698,7 @@ defmodule Pleroma.Web.Router do
post("/auth/password", MastodonAPIController, :password_reset)
scope [] do
get("/web/*path", MastodonAPIController, :index)
......@@ -3154,6 +3154,21 @@ test "redirects not logged-in users to the login page", %{conn: conn, path: path
assert redirected_to(conn) == "/web/login"
test "redirects not logged-in users to the login page on private instances", %{
conn: conn,
path: path
} do
is_public = Pleroma.Config.get([:instance, :public])
Pleroma.Config.put([:instance, :public], false)
conn = get(conn, path)
assert conn.status == 302
assert redirected_to(conn) == "/web/login"
Pleroma.Config.put([:instance, :public], is_public)
test "does not redirect logged in users to the login page", %{conn: conn, path: path} do
token = insert(:oauth_token)
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment