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

Feature/unverified user status #171

Merged
merged 8 commits into from
Jul 4, 2024
Merged

Conversation

JoshuaHinman
Copy link
Contributor

Description

Created new decorator @Unverified to allow permission for certain routes to unverified users
Also returns 403 forbidden for unverified users when accessing other routes
Added e2e tests

Issue link

Fixes # (86b0rfgv4)

Type of change

  • Bug fix (non-breaking change which fixes an issue)
  • Feature updates / changes
  • Tests
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

How Has This Been Tested?

Tested in Swagger:
Log in with: yoshi@gmail.com , password
Routes:

  • /auth/resend-email
  • /users/me
  • /auth/logout
  • /auth/verify - email can't be manually tested without verification token, but is covered in e2e test
  • /voyages/features/feature-categories - for 403 response

e2e: yarn test:e2e unverifiedUser

Checklist:

  • My code follows the style guidelines of this project
  • I have performed a self-review of my code
  • I have commented my code, particularly in hard-to-understand areas
  • I have made corresponding changes to the documentation
  • My changes generate no new warnings
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing tests pass locally with my changes
  • Any dependent changes have been merged and published in downstream modules
  • I have updated the change log

@JoshuaHinman JoshuaHinman self-assigned this Jun 30, 2024
Copy link
Contributor

@cherylli cherylli left a comment

Choose a reason for hiding this comment

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

Everything looks good, I ran all the tests, reseeded database, manually checked on swagger.

I think we should also update the readme under ##Custom Decorators

test/unverifiedUser.e2e-spec.ts Show resolved Hide resolved
Copy link
Contributor

@cherylli cherylli left a comment

Choose a reason for hiding this comment

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

thanks!

Copy link
Contributor

@timDeHof timDeHof left a comment

Choose a reason for hiding this comment

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

everything looks great! tested on swagger with the suggested test routes and ran yarn test:e2e unverifiedUser. Both passed!

@JoshuaHinman JoshuaHinman merged commit df21977 into dev Jul 4, 2024
1 check passed
@JoshuaHinman JoshuaHinman deleted the feature/unverified-user-status branch July 4, 2024 00:58
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