alan-turing-institute / AssurancePlatform

Project to facilitate creation of Assurance Cases
MIT License
19 stars 6 forks source link

[User Story] Require email for all TEA users #567

Open cptanalatriste opened 1 month ago

cptanalatriste commented 1 month ago

Role

As a TEA platform administrator

Desired Feature

I want to be able to register the email of every TEA user.

Benefit

So that I can uniquely identify users from multiple platforms.

Acceptance Criteria

GIVEN that I'm a new user to the TEA platform WHEN I'm in the sign-up form THEN I'm required to provide a unique username AND I am required to provide a valid email not present in the TEA database AND I am required to provide a secure password AND I am required to confirm the secure password provided.

GIVEN that I'm an existing TEA platform user WHEN I'm in the "Update Profile" page THEN I can provide a new unique username AND I can provide a new valid email not present in the TEA database AND I can provide a new secure password AND I am required to confirm the new secure password provided.

GIVEN that I'm an existing TEA platform user, without an email WHEN I interact with the TEA platform THEN I'm notified I need to provide an email to continue using the TEA platform.

Dependencies

No response

Technical Notes

If we want to use email for validation or password reset, there's an Azure service we can use. Prices don't look bad.

Definition of Done

chrisdburr commented 4 weeks ago

Prioritising this feature, as it is likely to serve as a dependancy for other featues, such as sharing cases with other users (see #561).

RichGriff commented 4 weeks ago

I have added the following to help manage this story on the frontend:

@chrisdburr @cptanalatriste thoughts on this?

RichGriff commented 4 weeks ago

https://github.com/user-attachments/assets/ea010a74-bcd6-44d7-bbae-0e82dc55a000

cptanalatriste commented 4 weeks ago

It's looking good @RichGriff ! When working on this feature, we need to make sure is disabled for users that use GitHub for logging.

RichGriff commented 4 weeks ago

@cptanalatriste ah yes we can make it read only if they are logged in via GitHub

cptanalatriste commented 4 weeks ago

@RichGriff there's a new endpoint for changing passwords. Please check the PR https://github.com/alan-turing-institute/AssurancePlatform/pull/576 for technical details.

RichGriff commented 4 weeks ago

Change password logic added

https://github.com/user-attachments/assets/dfca7c1d-8756-4853-b875-c72dc28ae542

@chrisdburr @cptanalatriste

RichGriff commented 3 weeks ago

I'm not sure if we can really force them to enter an email address. Will need to have a think what we can do here.

GIVEN that I'm an existing TEA platform user, without an email WHEN I interact with the TEA platform THEN I'm notified I need to provide an email to continue using the TEA platform.

cptanalatriste commented 3 weeks ago

@RichGriff maybe as a first approximation, I would suggest a modal/alert box after logging, with a text going like: "To use the TEA platform collaboration features, we require your email address. Please update your profile in the Settings page", and two buttons: 1) Cancel, 2) Go to Settings.

@chrisdburr what do you think?

chrisdburr commented 2 weeks ago

Yes, this would be fine as an initial fix. Please go ahead @RichGriff

RichGriff commented 6 days ago

I have added this into staging. I have assumed that we always want to show this when the user navigates to the homepage and they currently dont have an email set.

@chrisdburr please can you review, thanks.

chrisdburr commented 1 day ago

Hmmm, I actually don't know how to review this. I don't have an account that doesn't have an email already attached to it. Any suggestions? @cptanalatriste could you manually add a test account to the database and give it a try?

cptanalatriste commented 1 day ago

@chrisdburr , I can delete your email on staging. What's your username?