Skip to content

feat: OTP login implementation#215

Merged
qamarq merged 41 commits intomainfrom
feat/otp-login-implementation
Feb 17, 2025
Merged

feat: OTP login implementation#215
qamarq merged 41 commits intomainfrom
feat/otp-login-implementation

Conversation

@qamarq
Copy link
Copy Markdown
Member

@qamarq qamarq commented Feb 16, 2025

This pull request includes significant updates to both the backend and frontend of the project, primarily focusing on implementing OTP-based authentication and improving user data management. Additionally, there are updates to the project documentation and minor adjustments to existing functionalities.

Backend Changes:

  • AuthController Enhancements:

    • Added OTP-based login functionality, including methods to generate and verify OTP codes (backend/app/controllers/auth_controller.ts). [1] [2] [3]
    • Updated user creation and login logic to include user avatars and verification status (backend/app/controllers/auth_controller.ts).
  • User Model Updates:

    • Added new fields avatar, otpCode, otpExpire, and verified to the User model (backend/app/models/user.ts).
    • Updated the user table schema to include the new fields and removed unique constraint on usos_id (backend/database/migrations/1739705422939_prepare_users_table_to_otp.ts).
  • Email Notifications:

    • Modified email sending logic to include a new sender name and subject for notification emails (backend/commands/notifications.ts).
  • Route Adjustments:

    • Added new routes for OTP verification and login (backend/start/routes.ts).

Frontend Changes:

  • OTP Authentication Integration:

    • Added actions to handle sending OTP to email, verifying OTP, and setting user data (frontend/src/actions/login.ts).
    • Updated logout action to use a relative URL for the API endpoint (frontend/src/actions/logout.ts).
  • New Component:

    • Added a new promotional component for the ToPWr app (frontend/src/app/(homepage)/_components/topwr-ad.tsx).
  • Dependency Updates:

    • Added input-otp package to handle OTP input fields (frontend/package.json, frontend/package-lock.json). [1] [2] [3]

Documentation Update:

  • README Update:
    • Updated the welcome page image link in the README.md file (README.md).

These changes collectively enhance the security, functionality, and user experience of the project.

@qamarq qamarq self-assigned this Feb 16, 2025
@qamarq qamarq added the enhancement New feature or request label Feb 16, 2025
This was linked to issues Feb 16, 2025
@qamarq qamarq marked this pull request as ready for review February 16, 2025 18:17
@qamarq qamarq requested review from D0dii, Rei-x and olekszczepanowski and removed request for D0dii, Rei-x and olekszczepanowski February 16, 2025 18:17
@qamarq qamarq added the backend label Feb 17, 2025
Copy link
Copy Markdown
Member

@Rei-x Rei-x left a comment

Choose a reason for hiding this comment

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

TRZEBA SPRAWDZIĆ CZY RATE LIMIT ZADZIAŁA Z TRAEFIKIEM

możesz poprawić te rzeczy, ale nie jest to wymagane, nice-to-have

nadal ta funkcja auth mi się nie podoba, ale to lepiej będzie kiedyś razem siąść i byśmy sobie pogadali jak to zrobić, nie jest najgorzej teraz ale da się lepiej

@qamarq qamarq merged commit 1a2c8f7 into main Feb 17, 2025
2 checks passed
@qamarq qamarq deleted the feat/otp-login-implementation branch February 17, 2025 20:57
This was unlinked from issues Feb 17, 2025
This was linked to issues Feb 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Umami dla ToPWR Logowanie za pomocą One Time Password

5 participants