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

Use AuthDecorator for instantiation of account-related AuthPayloads #1722

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

iamacook
Copy link
Member

@iamacook iamacook commented Jul 4, 2024

Summary

When using the AuthGuard, we can be sure that the accessToken is present in the request. Currently, our account-related methods instantiate the relative AuthPayload individually. There is, however, a specific (Auth) decorator that handles instantiation.

This replaces the aforementioned for the creation, retrieval and deletion of accounts.

Changes

  • Expect an AuthPayload instead of AuthPayloadDto in AccountsController, AccountsService and AccountsRepository.
  • Use AuthPayload directly for authorisation in AccountsRepository,

@iamacook iamacook self-assigned this Jul 4, 2024
@iamacook iamacook requested a review from a team as a code owner July 4, 2024 08:50
@coveralls
Copy link

coveralls commented Jul 4, 2024

Pull Request Test Coverage Report for Build 9791338385

Details

  • 3 of 15 (20.0%) changed or added relevant lines in 3 files are covered.
  • 2 unchanged lines in 1 file lost coverage.
  • Overall coverage increased (+0.08%) to 48.578%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/routes/accounts/accounts.controller.ts 2 5 40.0%
src/domain/accounts/accounts.repository.ts 0 9 0.0%
Files with Coverage Reduction New Missed Lines %
src/domain/accounts/accounts.repository.ts 2 17.39%
Totals Coverage Status
Change from base Build 9780922225: 0.08%
Covered Lines: 4214
Relevant Lines: 6990

💛 - Coveralls

Copy link
Member

@hectorgomezv hectorgomezv left a comment

Choose a reason for hiding this comment

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

👏🏻

@iamacook iamacook merged commit 772a475 into main Jul 4, 2024
16 checks passed
@iamacook iamacook deleted the accounts-auth-payload branch July 4, 2024 11:39
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