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

[PB-3257] Migrate authentication and two-factor endpoints. #441

Merged
merged 9 commits into from
Dec 19, 2024

Conversation

evillalba94
Copy link
Contributor

@evillalba94 evillalba94 commented Dec 13, 2024

Ticket

Updates

###Endpoints

Authentication

  • [POST] /auth/login: Return security details
  • [POST] /auth/login/access: Allow the user access their account
  • [GET] /auth/logout: This will be used to register log [LOGOUT]

Two Factor Authentication

  • [GET] /auth/tfa: Return code and QR
  • [PUT] /auth/tfa: Update user 2FA
  • [DELETE] /auth/tfa: Remove user 2FA

@evillalba94 evillalba94 added the enhancement New feature or request label Dec 13, 2024
@evillalba94 evillalba94 self-assigned this Dec 13, 2024
src/modules/auth/auth.controller.ts Outdated Show resolved Hide resolved
src/modules/auth/auth.controller.ts Outdated Show resolved Hide resolved
src/modules/tfa/two-factor-auth.controller.ts Outdated Show resolved Hide resolved
src/modules/tfa/two-factor-auth.controller.ts Outdated Show resolved Hide resolved
src/modules/tfa/two-factor-auth.controller.ts Outdated Show resolved Hide resolved
src/modules/tfa/two-factor-auth.controller.ts Outdated Show resolved Hide resolved
src/modules/user/user.usecase.ts Outdated Show resolved Hide resolved
src/modules/auth/auth.controller.ts Outdated Show resolved Hide resolved
src/modules/auth/auth.controller.spec.ts Outdated Show resolved Hide resolved
@apsantiso
Copy link
Collaborator

It might be better to keep TFA endpoints within the auth module instead of creating separate modules. Adding a module just for a controller and a single repository (without any use case) can lead to too many modules as the API grows. To keep things manageable, it’s best to avoid adding extra modules unless necessary. Also, the login and loginAccess logic could fit in the auth module.

However, I understand the register User logic is currently handled in userUsecases. Just my opinion @sg-gs @evillalba94, take it with a grain of salt

src/modules/auth/auth.controller.ts Outdated Show resolved Hide resolved
src/modules/auth/auth.controller.ts Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
src/modules/auth/auth.controller.spec.ts Outdated Show resolved Hide resolved
src/modules/user/user.repository.ts Outdated Show resolved Hide resolved
src/modules/auth/two-factor-auth.service.ts Outdated Show resolved Hide resolved
src/modules/user/user.usecase.ts Outdated Show resolved Hide resolved
src/modules/user/user.usecase.ts Outdated Show resolved Hide resolved
src/modules/user/user.usecase.ts Outdated Show resolved Hide resolved
@sg-gs sg-gs merged commit 349ce80 into master Dec 19, 2024
11 checks passed
@sg-gs sg-gs deleted the feat/authentications branch December 19, 2024 13:04
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request ready-for-preview
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants