Skip to content

Commit

Permalink
Fix bc session parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
macifell committed May 21, 2024
1 parent c588195 commit b60167f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions lib/recognizer_web/router.ex
Original file line number Diff line number Diff line change
Expand Up @@ -35,17 +35,19 @@ defmodule RecognizerWeb.Router do

defp add_bc_to_session(%{query_params: %{"bc" => "true", "checkout" => "true"}} = conn, _opts) do
if Recognizer.BigCommerce.enabled?() do
put_session(conn, :bc, true)
put_session(conn, :bc_checkout, true)
conn
|> put_session(:bc_checkout, true)
|> put_session(:bc, true)
else
conn
end
end

defp add_bc_to_session(%{query_params: %{"bc" => "true"}} = conn, _opts) do
if Recognizer.BigCommerce.enabled?() do
delete_session(conn, :bc_checkout)
put_session(conn, :bc, true)
conn
|> delete_session(:bc_checkout)
|> put_session(:bc, true)
else
conn
end
Expand Down

0 comments on commit b60167f

Please sign in to comment.