Skip to content

fix: restrict public registration roles - #501

Open
Karam-preet wants to merge 1 commit into
mainfrom
Karam-preet/fix/restrict-public-registration-roles
Open

fix: restrict public registration roles#501
Karam-preet wants to merge 1 commit into
mainfrom
Karam-preet/fix/restrict-public-registration-roles

Conversation

@Karam-preet

Copy link
Copy Markdown
Collaborator

Summary

  • Restrict public registration to the employer role only.
  • Reject registration requests with a missing role.
  • Reject unauthorised roles such as admin, super_admin, and branch_admin.
  • Remove the previous fallback that allowed other roles to register.
  • Add tests covering allowed and rejected public registration roles.

Testing

  • npm test -- --runInBand tests/authController.test.js
  • All 13 tests passed.

Security Impact

Public registration can no longer be used to create privileged accounts such as administrators. Only the employer role is permitted through the public registration endpoint.

@Karam-preet
Karam-preet requested a review from LoopyB August 15, 2026 02:31
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.

2 participants