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

fix: server crashes on login if password is not provided in the request payload #1215

Open
wants to merge 6 commits into
base: dev
Choose a base branch
from

Conversation

iConnell
Copy link

@iConnell iConnell commented Mar 2, 2025

Description

This pr addrresses the issue in /api/v1/auth/login where the server crashes if the password field is not provided in the request payload. It also does a minor refactor where it combines two import statements into one in users.schemas

Related Issue (Link to issue ticket)

Fix: Server crashes on login if password is not provided in the request payload

Motivation and Context

🚀 Stability: Prevents unnecessary server crashes due to missing input.
🔍 Proper Validation: Ensures the API returns a 422 Unprocessable Entity error for missing passwords.
🔐 Security Fix: Prevents exposing stack traces or internal errors due to unhandled missing input.

How Has This Been Tested?

  • I wrote unit tests to automatically test the fix works as expected
  • I also tested it manually on postman and got the expected response

Screenshots (if appropriate - Postman, etc):


Screenshot 2025-03-01 at 11 06 21 PM

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.

@iConnell iConnell changed the title Fix: Server crashes on login if password is not provided in the request payload fix: server crashes on login if password is not provided in the request payload Mar 2, 2025
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.

1 participant