projects
/
akkoma
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
Rename regular expression 'have_re' to 'reply_prefix'.
[akkoma]
/
lib
/
pleroma
/
plugs
/
session_authentication_plug.ex
1
defmodule Pleroma.Plugs.SessionAuthenticationPlug do
2
import Plug.Conn
3
alias Pleroma.User
4
5
def init(options) do
6
options
7
end
8
9
def call(conn, _) do
10
with saved_user_id <- get_session(conn, :user_id),
11
%{auth_user: %{id: ^saved_user_id}} <- conn.assigns do
12
conn
13
|> assign(:user, conn.assigns.auth_user)
14
else
15
_ -> conn
16
end
17
end
18
end