projects
/
akkoma
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Added index on [:target_id, :relationship_type] to :user_relationships (speeds up...
[akkoma]
/
lib
/
pleroma
/
helpers
/
auth_helper.ex
diff --git
a/lib/pleroma/helpers/auth_helper.ex
b/lib/pleroma/helpers/auth_helper.ex
index 392fa7d5dc9f9ca827355f43ab3eae0b18ecefbc..13e4c815856294fe585ac91ec22199de4095eeb0 100644
(file)
--- a/
lib/pleroma/helpers/auth_helper.ex
+++ b/
lib/pleroma/helpers/auth_helper.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.Helpers.AuthHelper do
# SPDX-License-Identifier: AGPL-3.0-only
defmodule Pleroma.Helpers.AuthHelper do
@@
-20,20
+20,26
@@
defmodule Pleroma.Helpers.AuthHelper do
|> OAuthScopesPlug.skip_plug()
end
|> OAuthScopesPlug.skip_plug()
end
+ @doc "Drops authentication info from connection"
def drop_auth_info(conn) do
def drop_auth_info(conn) do
+ # To simplify debugging, setting a private variable on `conn` if auth info is dropped
conn
|> assign(:user, nil)
|> assign(:token, nil)
conn
|> assign(:user, nil)
|> assign(:token, nil)
+ |> put_private(:authentication_ignored, true)
end
end
+ @doc "Gets OAuth token string from session"
def get_session_token(%Conn{} = conn) do
get_session(conn, @oauth_token_session_key)
end
def get_session_token(%Conn{} = conn) do
get_session(conn, @oauth_token_session_key)
end
+ @doc "Updates OAuth token string in session"
def put_session_token(%Conn{} = conn, token) when is_binary(token) do
put_session(conn, @oauth_token_session_key, token)
end
def put_session_token(%Conn{} = conn, token) when is_binary(token) do
put_session(conn, @oauth_token_session_key, token)
end
+ @doc "Deletes OAuth token string from session"
def delete_session_token(%Conn{} = conn) do
delete_session(conn, @oauth_token_session_key)
end
def delete_session_token(%Conn{} = conn) do
delete_session(conn, @oauth_token_session_key)
end