Skip to content

Commit

Permalink
fix: Improve session handling in account v2 (blockscout#11420)
Browse files Browse the repository at this point in the history
  • Loading branch information
sl1depengwyn authored Jan 16, 2025
1 parent 9fb7db3 commit 967aa77
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ defmodule BlockScoutWeb.Account.API.V2.AuthenticateController do
{:identity, %Identity{} = identity} <- {:identity, Identity.find_identity(uid)} do
conn
|> Conn.fetch_session()
|> configure_session(renew: true)
|> put_session(:current_user, session)
|> delete_resp_cookie(Application.get_env(:block_scout_web, :invalid_session_key))
|> put_status(200)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ defmodule BlockScoutWeb.Account.API.V2.UserController do

{:new, session} ->
conn
|> configure_session(renew: true)
|> put_session(:current_user, session)
|> put_status(200)
|> render(:user_info, %{identity: identity |> Identity.put_session_info(session)})
Expand Down

0 comments on commit 967aa77

Please sign in to comment.