-
Notifications
You must be signed in to change notification settings - Fork 35
made attemptCount map to track # of attempts #2020
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
base: dev
Are you sure you want to change the base?
Changes from all commits
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 |
|---|---|---|
|
|
@@ -13,8 +13,13 @@ export async function verifyMembershipFromDb(token, confirmationCode) { | |
| }, | ||
| body: JSON.stringify({ confirmationCode }) | ||
| }); | ||
| status.responseData = res.status; | ||
| status.error = !res.ok; | ||
| if (res.status == TOO_MANY_ATTEMPTS) { | ||
|
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. is
for now |
||
| const data = await res.json(); | ||
| status.responseData = data; | ||
| status.error = false; | ||
| } else { | ||
| status.error = !res.ok; | ||
| } | ||
| } catch (err) { | ||
| status.error = true; | ||
| status.responseData = err; | ||
|
|
||
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
|
|
@@ -15,6 +15,10 @@ export default function VerifyMembershipModal(props) { | |||||
| user.token, | ||||||
| confirmationCode, | ||||||
| ); | ||||||
| if (apiResponse.remainingAttempts != undefined){ | ||||||
|
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.
Suggested change
|
||||||
| bannerCallback(`Wrong Code - You have ${apiResponse.remainingAttempts} left.`); | ||||||
| return; | ||||||
| } | ||||||
|
Comment on lines
18
to
21
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. if we reach this case we know what kind of error it is, we don't need to give them a status code |
||||||
| if (apiResponse.error) { | ||||||
| bannerCallback(`Unable to verify membership. Please try again later. Status Code: ${apiResponse.responseData || 500}`, 'red'); | ||||||
| return; | ||||||
|
|
||||||
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.