projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add OpenAPI spec for AdminAPI.UserController
[akkoma]
/
lib
/
pleroma
/
web
/
plugs
/
ensure_user_token_assigns_plug.ex
diff --git
a/lib/pleroma/web/plugs/ensure_user_token_assigns_plug.ex
b/lib/pleroma/web/plugs/ensure_user_token_assigns_plug.ex
index 4253458b224a8fae05d432f33396600d3b9f31e6..534b0cff188b4bd620bbbafdc57014db235f16ac 100644
(file)
--- a/
lib/pleroma/web/plugs/ensure_user_token_assigns_plug.ex
+++ b/
lib/pleroma/web/plugs/ensure_user_token_assigns_plug.ex
@@
-1,5
+1,5
@@
# Pleroma: A lightweight social networking server
# Pleroma: A lightweight social networking server
-# Copyright © 2017-202
0
Pleroma Authors <https://pleroma.social/>
+# Copyright © 2017-202
1
Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Plugs.EnsureUserTokenAssignsPlug do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Plugs.EnsureUserTokenAssignsPlug do
@@
-28,6
+28,11
@@
defmodule Pleroma.Web.Plugs.EnsureUserTokenAssignsPlug do
end
end
end
end
+ # App-bound token case (obtained with client_id and client_secret)
+ def call(%{assigns: %{token: %Token{user_id: nil}}} = conn, _) do
+ assign(conn, :user, nil)
+ end
+
def call(conn, _) do
conn
|> assign(:user, nil)
def call(conn, _) do
conn
|> assign(:user, nil)