-
Notifications
You must be signed in to change notification settings - Fork 1
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
Add forgot password component #104
Conversation
MaHaWo
commented
Oct 14, 2024
- add classical 'forgot password' page
- try to include backend API calls
- add localization: de, en
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #104 +/- ##
==========================================
- Coverage 15.75% 15.64% -0.12%
==========================================
Files 94 95 +1
Lines 4538 4571 +33
Branches 122 123 +1
==========================================
Hits 715 715
- Misses 3756 3788 +32
- Partials 67 68 +1 ☔ View full report in Codecov by Sentry. |
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.
lgtm - some minor suggestions
throwOnError: true | ||
}; | ||
|
||
await resetForgotPassword(data) |
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.
I think it's not recommended to mix await
and .then
styles - can lead to confusion (see e.g. this random blog post https://maximorlov.com/why-you-shouldnt-mix-promise-then-with-async-await/)
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.
ok. With respect to the linked blog post I don´t think it's a problem in this specific case because it has a catch block at the end, but as a general rule it's certainly valid...
|
||
const maildata = { | ||
component: Input, | ||
type: 'text', |
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.
if you make the type 'email' and make it required then you get validation of the email automatically: see e.g. https://github.com/ssciwr/mondey/blob/main/frontend/src/lib/components/Admin/Login.svelte#L24-L31
<DataInput | ||
component={maildata.component} | ||
bind:value={maildata.value} | ||
properties={maildata.props} | ||
/> | ||
</div> | ||
|
||
<div class="m-2 flex w-full items-center justify-center p-2"> | ||
<Button | ||
size="md" | ||
on:click={(event) => { | ||
valid = validateEmail(maildata.value); | ||
showAlert = !valid; | ||
if (valid) { | ||
submitData(maildata.value); |
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.
If you wrap the inputs in a form and make the button of type "submit" then the user pressing enter will press the button, e.g.
<form onsubmit={preventDefault(doLogin)}> |
<Button type="submit" class="mb-6">Login</Button> |
ok, I made the changes you remarked. you want to have another look @lkeegan or should I merge this? |
…dey-frontend-prototype into add-forgot-password-component
Quality Gate passedIssues Measures |