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 730c4ac742bb1fef3549dcbddd3e881ee20c4dad..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
@@
-2,17
+2,16
@@
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
# Copyright © 2017-2020 Pleroma Authors <https://pleroma.social/>
# SPDX-License-Identifier: AGPL-3.0-only
-defmodule Pleroma.Plugs.SetUserSessionIdPlug do
- import Plug.Conn
- alias Pleroma.
User
+defmodule Pleroma.
Web.
Plugs.SetUserSessionIdPlug do
+ 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