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

feat(idp-migration): redirection for account confirmation link #29003

Merged
merged 44 commits into from
Oct 6, 2021

Conversation

maxiuyuan
Copy link
Contributor

@maxiuyuan maxiuyuan commented Sep 30, 2021

pages to redirect to after user clicks confirm account link in email

image
image

RyanSkonnord and others added 30 commits September 15, 2021 16:00
When a user supplies unrecognized SSO credentials associated with an
email address for an existing user profile, offer them a chance to link
their identity to that profile instead of automatically provisioning a
new profile.

Introduce a feature flag. The feature is incomplete and will hit
unimplemented code if the flag is set.
from sentry.web.helpers import render_to_response


def _respond(
Copy link
Member

Choose a reason for hiding this comment

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

is this function here for typing purposes? it doesn't add much IMO, setting a 302 is fine to do in two places.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

i made a private function for this since auth helper used it for the exact same purpose, looking at it, it doesn't add much and could be replaced with a direct render_to_response() call.

Something went wrong and your email could not be confirmed. Click the button below to go back to the login page.
</p>

<a href="{{ url }}" class="btn">Go back</a>
Copy link
Member

Choose a reason for hiding this comment

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

A back button in an email is unusual.

Copy link
Member

Choose a reason for hiding this comment

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

this one isn't in an email -- perhaps the filename is a tad ambiguous.


<form class="form-stacked" action="" method="post"> {% csrf_token %}
<a href="{{ url }}" class="btn" type="submit">Continue</a>
</form>
Copy link
Member

Choose a reason for hiding this comment

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

Why is there a link inside a form? I don't think you'll have much luck with a form inside an email either.

return redirect
# TODO add view that shows key not found
return HttpResponseNotFound()
class IDPView(BaseView):
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
class IDPView(BaseView):
class AccountConfirmationView(BaseView):

Copy link
Member

Choose a reason for hiding this comment

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

would prefer to have things named account_verification around this feature, as email_verification is a seperate feature we don't want to conflate.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sounds good, i've changed the name of this class

@@ -0,0 +1,15 @@
{% extends "sentry/emails/base.html" %}
Copy link
Member

Choose a reason for hiding this comment

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

if we have extra time at the end of this project, we should see if it would be an easy swap to react views for these

Copy link
Contributor Author

Choose a reason for hiding this comment

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

should i make tickets for these and work on it if i have time at the end/during spare cycles?

Copy link
Member

Choose a reason for hiding this comment

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

sounds good.

# TODO add view that shows key not found
return HttpResponseNotFound()
class AccountConfirmationView(BaseView):
auth_required = False
Copy link
Member

Choose a reason for hiding this comment

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

would add a quick comment explaining that the user using this endpoint is currently locked out of their account, so auth isn't required on this endpoint.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants