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

Email verification #635

Merged
merged 3 commits into from
Mar 1, 2025
Merged

Conversation

remioluwatomi
Copy link
Contributor

@remioluwatomi remioluwatomi commented Feb 28, 2025

Description

This PR ensures that users must have a verified email before performing certain actions by enforcing email verification checks in middleware. It also updates test cases to properly handle email verification when creating users.

Related Issue (Link to Github issue)

Feat #620

Motivation and Context

Additional Security and Authentication Layer -> This PR addresses that by ensuring users have the email_verified_at field set. Additionally, it reinforces middleware checks for verified users.

How Has This Been Tested?

  • Created test users with email_verified_at set.
  • Ran the full test suite to confirm that previously failing tests now pass.
  • Ensured that authentication and authorization behaviors remain unchanged apart from the intended verification requirement.
    -Modified previous test to factor in the new Email Verification system. This test include:
    • InvitationTest.php
    • UserDeletionTest.php

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

Implement Laravel's MustVerifyEmail, verification routes, and protected middleware to ensure users verify their email before accessing protected routes. Improves security and prevents fake sign-ups.
Implement email.verified middleware (EnsureEmailIsVerified Middleware)
Updated the test to factor in email verification
syncing local branch with remote upstream repo
@omotomiwa26 omotomiwa26 added the enhancement New feature or request label Feb 28, 2025
- Catch InvalidSignatureException - to check for Invalid/Expired Verification Link
- Ensure expired or invalid verification links return a proper JSON response
@bhimbho bhimbho merged commit 307820c into hngprojects:dev Mar 1, 2025
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants