Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Handling of SSO Linking #907

Merged
merged 10 commits into from
Sep 18, 2024
Merged

Conversation

aaronskiba
Copy link
Collaborator

@aaronskiba aaronskiba commented Sep 16, 2024

Fixes #900
Changes proposed in this PR:

  • Update the handling of SSO linking in some user case scenarios.

Previously, SSO account linking of existing accounts was possible for signed-out users. This commit disables that functionality. Users must now be signed into the app to link to an existing account.
Copy link
Collaborator

@lagoan lagoan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a good start.

There are a couple of places that could be improved.

app/controllers/users/omniauth_callbacks_controller.rb Outdated Show resolved Hide resolved
app/models/user.rb Outdated Show resolved Hide resolved
This change adds the PR idea from #902.
The change seeks to address the following issue: #900

Co-Authored-By: Omar Rodriguez Arenas <[email protected]>
@aaronskiba aaronskiba marked this pull request as ready for review September 17, 2024 17:14
@closenma
Copy link
Collaborator

closenma commented Sep 17, 2024

Proposed English:
That email appears to be associated with an existing account. \ Sign into your existing account, and you can link with SSO from the 'Edit Profile' page.
Translation is standing by to get us a quick version in French

@closenma
Copy link
Collaborator

Got back from translation - small rephrase on both - use these versions, please

English: That email appears to be associated with an existing account. \ Sign into your existing account, and you can link that account with SSO from the 'Edit Profile' page.

French: Il paraît que cette adresse couriel est dejà associée à un compte existant. \ Veuillez vous connecter à votre compte existant, et vous pouvez le lier à l'aide de la fonction SSO à partir de la page 'Modifier le profil'.

To work properly, this test relies on the `current_user` method within `app/controllers/users/omniauth_callbacks_controller.rb`. Howerver, `current_user` is not currently behaving as expected there. Thus, the test is being commented out.
lagoan
lagoan previously approved these changes Sep 18, 2024
Copy link
Collaborator

@lagoan lagoan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

lagoan
lagoan previously approved these changes Sep 18, 2024
Copy link
Collaborator

@lagoan lagoan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@aaronskiba
Copy link
Collaborator Author

bundle exec rspec ./spec/integration/openid_connect_sso_spec.rb:42 has an outdated button name. The test passes when I update it. If I change it I lose the PR approval, but I have no one to re-approve. Merging as is.

$ bundle exec rspec ./spec/integration/openid_connect_sso_spec.rb:42
To use retry middleware with Faraday v2.0+, install `faraday-retry` gem
Copying Bootstrap glyphicons to the public directory ...
Copying TinyMCE skins to the public directory ...
Run options: include {:locations=>{"./spec/integration/openid_connect_sso_spec.rb"=>[42]}}

Randomized with seed 11395
.

Top 1 slowest examples (1.91 seconds, 55.2% of total time):
  Openid_connection SSO with correct credentials does not create SSO link when user is signed out and SSO email is an existing account email
    1.91 seconds ./spec/integration/openid_connect_sso_spec.rb:42

Finished in 3.47 seconds (files took 4.85 seconds to load)
1 example, 0 failures

Randomized with seed 11395

@aaronskiba aaronskiba merged commit 71ff980 into deployment-portage Sep 18, 2024
9 of 12 checks passed
@aaronskiba aaronskiba deleted the aaron/issues/sso-link branch September 18, 2024 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ActiveRecord::RecordInvalid: Validation failed: Email has already been taken
3 participants