-
Notifications
You must be signed in to change notification settings - Fork 3
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
DON-752: Create login page #1401
Conversation
Purely the result of running `ng generate component --standalone login`
…modal There may be scope to tidy up by removing some duplication, or it might be that the code needs to be tweaked a bit for the different context and so two separate copies makes more sense.
(I'd like the message not to be red though)
(makes sense in the modal, doesn't make sense in the full page version)
Cancel was copied from modal, doesn't make sense in page context
…ntend on login This can be used to make the login page work as a gate in front of any other page that will require login to see
if (! isLoggedIn) { | ||
return true; | ||
} else { | ||
return router.parseUrl('/'); |
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.
todo - inject the Activated route and redirect the same way that the login component does on successful login, i.e. not always to the home page.
siteKey="{{ recaptchaIdSiteKey }}" | ||
></re-captcha> | ||
|
||
<div *ngIf="forgotPassword else logIn"> |
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.
may or may not want to move forgotPassword out to a separate page.
]], | ||
password: [null, [ | ||
Validators.required, | ||
Validators.minLength(10), |
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.
not sure it's worth having a minLength validation on the password field here. It's here because I copied this from the login modal. Min length is good when setting a new password, but I think it might be more confusing than helpful when trying to authenticate with an existing password.
The only password validation rule as far as the user is concerned here is that the password has to match what's set on the account. Yes we know that that implies it will be at least 10 characters, but that feels a bit arbitrary to enforce here.
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 you're right, I don't remember being notified about password length on any login page, but maybe it's good to check length at the form level before checking against db, as we know it can't be right and won't make unnecessary db calls?
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 if we do that for performance reasons then we don't need to tell the user about it, as it just makes things more complicated for them - and if we do it it makes more sense to do it in the Identity server instead of in frontend. I'll leave it here for now but likely change in a later PR.
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
Login page is at
/login
Includes function to redirect the user to any other page on the site if
?r=<redirectTarget>
is added to the URL. My plan is to use a router guard to redirect attempts to access pages likemy-account
to/login?r=my-account