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

Add backend connection to user login #115

Merged
merged 31 commits into from
Oct 17, 2024

Conversation

MaHaWo
Copy link
Collaborator

@MaHaWo MaHaWo commented Oct 15, 2024

  • make use of backend functionality in login, profile popover and user registration
  • add localization where needed
  • add 'success' page to user registration
  • add error handling where necessary
  • make better usage of forms
  • wrt roles: Currently a user can request a role upon registration, and then would get an e-mail with further instructions on how to get that role (provide verification of a research institution or special admin access token or whatever). The rest of the verification process would then be:
    • normal observer: click link and be done, as normal
    • researcher: verify with institution?
    • admin: verify with admin token (whatever that may be) obtained from an existing admin?
    • currently, only the role request is implemented in the frontend.
    • is there a standard process for this?
  • Question: does the role have to go into the login too? or should this be automatically determined from the database? ( I assume the latter)
  • missing currently:
    • english translations
    • users remain unverified add email to backend #109
    • no 'reset password' functionality yet in itself. that would have to happen in the user landing page under an additional tab? (can be a late addition imho...)
    • no integration with the admin user stuff yet.

@codecov-commenter
Copy link

codecov-commenter commented Oct 15, 2024

Codecov Report

Attention: Patch coverage is 0.49505% with 201 lines in your changes missing coverage. Please review.

Project coverage is 16.23%. Comparing base (3b8b826) to head (39cc4b2).

Files with missing lines Patch % Lines
...rontend/src/lib/components/UserRegistration.svelte 0.00% 80 Missing ⚠️
frontend/src/lib/components/UserLogin.svelte 0.00% 62 Missing ⚠️
frontend/src/lib/components/UserProfile.svelte 0.00% 31 Missing ⚠️
frontend/src/lib/components/UserLandingPage.svelte 0.00% 11 Missing ⚠️
mondey_backend/src/mondey_backend/users.py 11.11% 8 Missing ⚠️
frontend/src/lib/components/UserVerify.svelte 0.00% 5 Missing and 1 partial ⚠️
frontend/src/lib/stores/userStore.ts 0.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main     #115      +/-   ##
==========================================
+ Coverage   16.15%   16.23%   +0.07%     
==========================================
  Files          97       98       +1     
  Lines        4846     4829      -17     
  Branches      124      125       +1     
==========================================
+ Hits          783      784       +1     
+ Misses       3994     3975      -19     
- Partials       69       70       +1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@MaHaWo MaHaWo requested a review from lkeegan October 16, 2024 12:44
…iwr/mondey-frontend-prototype into add-backend-connection-to-user-login
Copy link
Member

@lkeegan lkeegan left a 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

frontend/src/lib/components/UserLogin.svelte Show resolved Hide resolved
frontend/src/lib/stores/userStore.ts Outdated Show resolved Hide resolved
Comment on lines 24 to 26
// TODO: remove this in the final version, this sets verified to true
// to emulate a successful user registration
returned.data.is_verified = true;
Copy link
Member

Choose a reason for hiding this comment

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

I think it makes more sense to make the backend set is_verified=true on signup for now until #109 is implemented

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

ok... did that now in on_after_register in the users.py file. find entry in database corresponding to the passed user object, set the verified flag -> write back to database.

Copy link

@lkeegan lkeegan merged commit 5e2c9bc into main Oct 17, 2024
5 checks passed
@lkeegan lkeegan deleted the add-backend-connection-to-user-login branch October 17, 2024 11: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.

3 participants