-
Notifications
You must be signed in to change notification settings - Fork 166
Lg 15251 avoid linking email address #11717
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
Changes from all commits
67ffa13
1cf573d
b5c52d2
3348e2a
321b9c3
8c1833a
2176080
4574c6f
cd4a35d
40ddc21
7681ca4
5cc5b03
ff39621
a19f8a0
a537d91
ff56fa7
8c772dd
9241d71
dcb3700
d0875e8
a2e873f
74faffd
3354908
adbf97e
65ee172
d41b386
62686de
50c9343
8ca969d
e98798a
1e717ea
e8cb132
bed0636
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -14,7 +14,7 @@ def edit | |
| @select_email_form = build_select_email_form | ||
| @can_add_email = EmailPolicy.new(current_user).can_add_email? | ||
| analytics.sp_select_email_visited | ||
| @email_id = @identity.email_address_id || last_email | ||
| @email_id = @identity.email_address_id || last_email_id | ||
| end | ||
|
|
||
| def update | ||
|
|
@@ -52,7 +52,7 @@ def identity | |
| @identity = current_user.identities.find_by(id: params[:identity_id]) | ||
| end | ||
|
|
||
| def last_email | ||
| def last_email_id | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nice clarifying rename 👍 |
||
| current_user.last_sign_in_email_address.id | ||
| end | ||
| end | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -90,10 +90,12 @@ def link_identity_to_service_provider | |||||||||
|
|
||||||||||
| def email_address_id | ||||||||||
| return nil unless IdentityConfig.store.feature_select_email_to_share_enabled | ||||||||||
| identity = current_user.identities.find_by(service_provider: sp_session[:issuer]) | ||||||||||
| return nil if !identity&.verified_single_email_attribute? | ||||||||||
| if user_session[:selected_email_id_for_linked_identity].present? | ||||||||||
| return user_session[:selected_email_id_for_linked_identity] | ||||||||||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm still seeing ways that identity-idp/app/controllers/sign_up/completions_controller.rb Lines 24 to 27 in d32e350
I think we should do an audit of It could also be a good idea to have an integration test that has the user walk through a consent flow for different requested attributes and check the resulting behavior /
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I added the test. above. But looking at the calls it looks like this location is the only place that the identity linker is being updated with email address id. the authorization controller and saml_auth_concern. @aduth
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok in that case I think it makes sense the change to change order to ensure we abort as early as possible in this method if the identity doesn't have the correct |
||||||||||
| end | ||||||||||
| identity = current_user.identities.find_by(service_provider: sp_session[:issuer]) | ||||||||||
|
|
||||||||||
| identity&.email_address_id | ||||||||||
| end | ||||||||||
|
|
||||||||||
|
|
||||||||||
Uh oh!
There was an error while loading. Please reload this page.