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 e520159e4aaa5211e254e47c9e610a18bc80e307..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,16
+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
- conn
- |> put_session(: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