Auth route /whoami for nginx subrequest auth, support changing the session cookie domain for that purpose

This commit is contained in:
bluepython508
2023-11-08 09:36:30 +00:00
parent 54db8727b0
commit 93cd897b0e
6 changed files with 20 additions and 4 deletions

View File

@@ -23,4 +23,13 @@ defmodule SsoBsnWeb.UserSessionController do
|> put_flash(:info, "Logged out successfully.")
|> UserAuth.log_out_user()
end
def check_auth(conn, _params) do
user = conn.assigns[:current_user]
conn
|> put_resp_header("X-Auth-Username", user.username)
|> json(%{
username: user.username
})
end
end