Skip to content

Commit

Permalink
update the cookie name for Rails
Browse files Browse the repository at this point in the history
  • Loading branch information
stepchud committed Oct 8, 2024
1 parent 1ff4641 commit 329b030
Show file tree
Hide file tree
Showing 4 changed files with 6 additions and 5 deletions.
3 changes: 2 additions & 1 deletion .envrc
Original file line number Diff line number Diff line change
Expand Up @@ -13,4 +13,5 @@ PATH_add $MIX_HOME/bin
PATH_add $HEX_HOME/bin

export LOGIN_SECRET="f4d3c40a00a8e6ed72fae5204d9ddacd40f087865d40803a6fcfb935591a271838533f06081067dac24c0085c74123e7e1c8b3e0ab562c6645b17eb769854d0d"
export JWT_SECRET="fc28c5738ca45162f61126e770a8fbdbd938d0fedcfe8fbb9f851b855b0264866364a9130e96aca8b1977e9f58edf064f1aa435ceccf415ff22fd3c24adba320"
export JWT_SECRET="fc28c5738ca45162f61126e770a8fbdbd938d0fedcfe8fbb9f851b855b0264866364a9130e96aca8b1977e9f58edf064f1aa435ceccf415ff22fd3c24adba320"
export SESSION_COOKIE_DOMAIN="localhost"
4 changes: 2 additions & 2 deletions lib/challenge_gov/challenges.ex
Original file line number Diff line number Diff line change
Expand Up @@ -772,9 +772,9 @@ defmodule ChallengeGov.Challenges do
def is_allowed_to_view_submission?(user = %{role: "challenge_manager"}),
do: validate_gov_mil?(user.email)

def is_allowed_to_view_submission?(user = %{role: "super_admin"}), do: true
def is_allowed_to_view_submission?(%{role: "super_admin"}), do: true

def is_allowed_to_view_submission?(user = %{role: "admin"}), do: true
def is_allowed_to_view_submission?(%{role: "admin"}), do: true

def allowed_to_submit?(%{role: "super_admin"}), do: true

Expand Down
2 changes: 1 addition & 1 deletion lib/web/controllers/api/session_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,6 @@ defmodule Web.Api.SessionController do
end

defp clear_rails_session(conn) do
delete_resp_cookie(conn, "_rails_new_session")
delete_resp_cookie(conn, "_challenge_platform_key")
end
end
2 changes: 1 addition & 1 deletion lib/web/controllers/session_controller.ex
Original file line number Diff line number Diff line change
Expand Up @@ -181,6 +181,6 @@ defmodule Web.SessionController do
end

defp clear_rails_session(conn) do
delete_resp_cookie(conn, "_rails_new_session")
delete_resp_cookie(conn, "_challenge_platform_key")
end
end

0 comments on commit 329b030

Please sign in to comment.