-
Notifications
You must be signed in to change notification settings - Fork 10
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
One login Account Recovery #10215
One login Account Recovery #10215
Conversation
Database-level enum changes detected Please include a data migration for these attributes and values:
|
40107f8
to
11f5678
Compare
11f5678
to
6cb8a27
Compare
63eb05d
to
b29f1d8
Compare
b29f1d8
to
73518d0
Compare
73518d0
to
41186e2
Compare
41186e2
to
62f6def
Compare
62f6def
to
8ce7429
Compare
8ce7429
to
8577ebf
Compare
8577ebf
to
53c00fa
Compare
scope :not_expired, -> { where('created_at >= ?', 15.minutes.ago) } | ||
|
||
def self.generate_code | ||
Array.new(6) { rand(0..9) }.join |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We don't care about other candidates having the same code because the code is scoped to a specific candidate
apply-for-teacher-training/app/forms/candidate_interface/account_recovery_form.rb
Line 21 in 8f15e68
valid_request_code = current_candidate.account_recovery_request.codes.not_expired.find do |requested_code| |
I think we can ignore this. All the candidates have 'not_started' as their |
53c00fa
to
b96da27
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice work! A few comments from me before I test on QA.
I18n.t('page_titles.account_recovery', email: current_candidate.previous_account_email_address) | ||
end %> | ||
|
||
<% content_for :title, page_title %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<% content_for :title, page_title %> | |
<% content_for :title, title_with_error_prefix(page_title, @account_recovery.errors.any?) %> |
If there is a form error, the page title should change to be Error: page_title
@@ -0,0 +1,27 @@ | |||
<% content_for :title, t('page_titles.account_recovery_request') %> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
<% content_for :title, t('page_titles.account_recovery_request') %> | |
<% content_for :title, title_with_error_prefix(t('page_titles.account_recovery_request'), @account_recovery_request.errors.any?) %> |
app/views/candidate_interface/account_recovery_requests/new.html.erb
Outdated
Show resolved
Hide resolved
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for addressing all the comments! This looks great. I haven't tested it on QA, but I know Rebecca and Pete have and we'll do more at the bug party on Thursday, so happy for the code to go in!
When going live with one login, a candidate can sign up with a different email address, not the magic link email address. For this, we need to allow our candidates to recover their 'old' account. This commit adds this feature. We show a banner which the candidate can dismiss or they can click to recover their old account. They will be asked to input their old email and a code will be sent to their email. The code is encrypted with bcrypt.
fd9eabf
to
8e9360f
Compare
Context
When going live with one login, a candidate can sign up with a different
email address, not the magic link email address.
For this, we need to allow our candidates to recover their 'old'
account. This commit adds this feature.
We show a banner which the candidate can dismiss or they can click to
recover their old account. They will be asked to input their old email
and a code will be sent to their email. The code is encrypted with
bcrypt.
Changes proposed in this pull request
Account recovery forms
button_to style to look like a link
specs
Guidance to review
Go on QA and try to recover an account. The account that you recover needs to exist in QA DB.
I have created candidates in the QA DB for you to recover.
[email protected]
Created 3 accounts so you can go +apply up to 3.Things to check