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

feat: 2fa #48

Merged
merged 10 commits into from
Jan 22, 2024
Merged

feat: 2fa #48

merged 10 commits into from
Jan 22, 2024

Conversation

nicolasauler
Copy link
Owner

@nicolasauler nicolasauler commented Jan 16, 2024

Added 2fa generation as QR code and validation.

Added roles to login:

  • Non-user: not signed up, can access only auth routes
  • Pseudo-user is the role assigned after email verification, but before 2fa verificaition: in this role, user can only access auth routes + 2fa routes
  • User: can access all routes

Renamed expense_type to category so to avoid using a language keyword.

Also, applied more clippy lints and made application more production-ready, still a lot of unwraps() to go, though.

TODO:

  • Fix QR code and MFA screen being shown inside of sign in tab.
  • Restructure app into models and make schema separation more legible.
  • Generate Cargo Doc

Closes #19

TODO: login with weak role even without 2FA, so that it needs login to
access 2fa routes, but can't access other routes without 2fa.
Extracted templates to separate rust file.
Fixed non-async functions marked as async.
Bug: error message in sign-in is being shown on screen.
Now user after email verification and before 2FA is a pseudo-user, with permissions
only to access 2fa related routes.
And user after 2fa is a full user.
@nicolasauler nicolasauler merged commit 83c5c4f into main Jan 22, 2024
3 of 4 checks passed
@nicolasauler nicolasauler deleted the 2fa branch January 22, 2024 12:47
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.

feat: auth - Add 2FA
1 participant