-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #128 from GSA/56/shared-rails-phoenix-session
[56] Implement shared session between Rails <=> Phoenix
- Loading branch information
Showing
8 changed files
with
113 additions
and
35 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,8 @@ | ||
# local dev env vars for login.gov | ||
export LOGIN_CLIENT_ID=urn:gov:gsa:openidconnect.profiles:sp:sso:gsa:challenge_gov_portal_eval_dev | ||
export LOGIN_REDIRECT_EVAL_URL=http://localhost:3000/auth/result | ||
export LOGOUT_REDIRECT_EVAL_URL=http://localhost:3000/ | ||
export LOGOUT_REDIRECT_EVAL_URL=http://localhost:3000/ | ||
|
||
export PHOENIX_URI="http://localhost:4000" | ||
export LOGIN_SECRET="f4d3c40a00a8e6ed72fae5204d9ddacd40f087865d40803a6fcfb935591a271838533f06081067dac24c0085c74123e7e1c8b3e0ab562c6645b17eb769854d0d" | ||
export JWT_SECRET="fc28c5738ca45162f61126e770a8fbdbd938d0fedcfe8fbb9f851b855b0264866364a9130e96aca8b1977e9f58edf064f1aa435ceccf415ff22fd3c24adba320" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -30,12 +30,10 @@ | |
end | ||
|
||
it "get /auth/result successful" do | ||
user = User.new(email: "[email protected]", token: SecureRandom.uuid) | ||
code = "ABC123" | ||
login_gov = instance_double(LoginGov) | ||
allow(LoginGov).to receive(:new).and_return(login_gov) | ||
allow(login_gov).to receive(:exchange_token_from_auth_result).with(code).and_return( | ||
[{ email: "[email protected]", sub: "sub" }] | ||
) | ||
mock_login_gov(user, code) | ||
|
||
get "/auth/result", params: { code: } | ||
expect(response).to have_http_status(:redirect) | ||
expect(response).to redirect_to("/dashboard") | ||
|
@@ -47,14 +45,11 @@ | |
email = "[email protected]" | ||
token = SecureRandom.uuid | ||
|
||
User.create!({ email:, token: }) | ||
user = User.create!({ email:, token: }) | ||
|
||
code = "ABC123" | ||
login_gov = instance_double(LoginGov) | ||
allow(LoginGov).to receive(:new).and_return(login_gov) | ||
allow(login_gov).to receive(:exchange_token_from_auth_result).with(code).and_return( | ||
[{ email:, sub: token }] | ||
) | ||
mock_login_gov(user, code) | ||
|
||
get "/auth/result", params: { code: } | ||
|
||
expect(session[:userinfo]).not_to be_nil | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters