projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Call ConfirmUserPlug from Router, not Endpoint
[akkoma]
/
lib
/
pleroma
/
web
/
plugs
/
set_user_session_id_plug.ex
diff --git
a/lib/pleroma/web/plugs/set_user_session_id_plug.ex
b/lib/pleroma/web/plugs/set_user_session_id_plug.ex
index 6ddb6b5e58fe9db12445da3260ed4cf2d3b467e2..9f4a6b6acb218d0456fe7638501ab378513886df 100644
(file)
--- a/
lib/pleroma/web/plugs/set_user_session_id_plug.ex
+++ b/
lib/pleroma/web/plugs/set_user_session_id_plug.ex
@@
-3,15
+3,15
@@
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Plugs.SetUserSessionIdPlug do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Web.Plugs.SetUserSessionIdPlug do
- import Plug.Conn
- alias Pleroma.
User
+ alias Pleroma.Helpers.AuthHelper
+ alias Pleroma.
Web.OAuth.Token
def init(opts) do
opts
end
def init(opts) do
opts
end
- def call(%{assigns: %{
user: %User{id: id}
}} = conn, _) do
-
put_session(conn, :user_id, id
)
+ def call(%{assigns: %{
token: %Token{} = oauth_token
}} = conn, _) do
+
AuthHelper.put_session_token(conn, oauth_token.token
)
end
def call(conn, _), do: conn
end
def call(conn, _), do: conn