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

DON-752: Create login page #1401

Merged
merged 13 commits into from
Nov 29, 2023
Merged

DON-752: Create login page #1401

merged 13 commits into from
Nov 29, 2023

Conversation

bdsl
Copy link
Contributor

@bdsl bdsl commented Nov 27, 2023

image

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 like my-account to /login?r=my-account

bdsl added 3 commits November 27, 2023 14:42
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.
@bdsl bdsl changed the title DON-752: Create blank login component DON-752: Create login page Nov 27, 2023
bdsl added 7 commits November 27, 2023 15:18
(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
@bdsl bdsl marked this pull request as ready for review November 27, 2023 17:13
@bdsl bdsl changed the base branch from develop to deploy-after-cc23 November 27, 2023 17:16
if (! isLoggedIn) {
return true;
} else {
return router.parseUrl('/');
Copy link
Contributor Author

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.

src/app/app-routing.ts Outdated Show resolved Hide resolved
siteKey="{{ recaptchaIdSiteKey }}"
></re-captcha>

<div *ngIf="forgotPassword else logIn">
Copy link
Contributor Author

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),
Copy link
Contributor Author

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.

Copy link
Contributor

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?

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 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.

Copy link
Contributor

@dorota-joanna dorota-joanna left a comment

Choose a reason for hiding this comment

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

LGTM

@bdsl bdsl merged commit 5075981 into deploy-after-cc23 Nov 29, 2023
2 checks passed
@bdsl bdsl deleted the DON-752-create-login-page branch November 29, 2023 16:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants