summaryrefslogtreecommitdiff
path: root/test/plugs/legacy_authentication_plug_test.exs
diff options
context:
space:
mode:
authorIvan Tashkinov <ivantashkinov@gmail.com>2020-04-17 21:21:10 +0300
committerIvan Tashkinov <ivantashkinov@gmail.com>2020-04-17 21:21:10 +0300
commit66f55106bda23e0cfb01cb63f7397f4383518963 (patch)
tree6f3cd7d3d75a138d23235d4ab05328785c6278d3 /test/plugs/legacy_authentication_plug_test.exs
parente0d7847bc56c61156c8df0e7a94d728b82bf2d86 (diff)
downloadpleroma-66f55106bda23e0cfb01cb63f7397f4383518963.tar.gz
pleroma-66f55106bda23e0cfb01cb63f7397f4383518963.zip
[#1682] Fixed Basic Auth permissions issue by disabling OAuth scopes checks when password is provided. Refactored plugs skipping functionality.
Diffstat (limited to 'test/plugs/legacy_authentication_plug_test.exs')
-rw-r--r--test/plugs/legacy_authentication_plug_test.exs6
1 files changed, 5 insertions, 1 deletions
diff --git a/test/plugs/legacy_authentication_plug_test.exs b/test/plugs/legacy_authentication_plug_test.exs
index 7559de7d3..3b8c07627 100644
--- a/test/plugs/legacy_authentication_plug_test.exs
+++ b/test/plugs/legacy_authentication_plug_test.exs
@@ -8,6 +8,8 @@ defmodule Pleroma.Plugs.LegacyAuthenticationPlugTest do
import Pleroma.Factory
alias Pleroma.Plugs.LegacyAuthenticationPlug
+ alias Pleroma.Plugs.OAuthScopesPlug
+ alias Pleroma.Plugs.PlugHelper
alias Pleroma.User
setup do
@@ -36,7 +38,8 @@ defmodule Pleroma.Plugs.LegacyAuthenticationPlugTest do
end
@tag :skip_on_mac
- test "it authenticates the auth_user if present and password is correct and resets the password",
+ test "if `auth_user` is present and password is correct, " <>
+ "it authenticates the user, resets the password, marks OAuthScopesPlug as skipped",
%{
conn: conn,
user: user
@@ -49,6 +52,7 @@ defmodule Pleroma.Plugs.LegacyAuthenticationPlugTest do
conn = LegacyAuthenticationPlug.call(conn, %{})
assert conn.assigns.user.id == user.id
+ assert PlugHelper.plug_skipped?(conn, OAuthScopesPlug)
end
@tag :skip_on_mac