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(auth): enable password reset with API key authentication (#6728) #6774

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

dvladimirov
Copy link

Fix Password Reset with API Key Authentication

Issue

Users are unable to reset their passwords when authenticated via API key, while the same functionality works with JWT tokens.

Changes

  • Modified api_key_security to properly handle database sessions through dependency injection
  • Removed conversion to UserRead model to maintain full User model functionality
  • Simplified authentication logic by consolidating functions
  • Cleaned up unused imports

Testing

  1. Start Langflow
  2. Try resetting password using API key:

bash
curl -L -X PATCH 'http://127.0.0.1:7860/api/v1/users/{user_id}/reset-password' \ -H 'Accept: application/json' \ -H "X-API-Key: $LANGFLOW_API_KEY" \ -H "Content-Type: application/json" \ -d "{\"password\": \"new_password\"}"

Additional Notes

  • No database schema changes required
  • No new dependencies added
  • Maintains backward compatibility with existing authentication methods

Fixes #6728

Im not sure about the .gitignore part though i added it so we don't get a lot of information which is not related to the changes. If you want i can remove it from there.

@dosubot dosubot bot added size:M This PR changes 30-99 lines, ignoring generated files. bug Something isn't working labels Feb 23, 2025
@github-actions github-actions bot added bug Something isn't working and removed bug Something isn't working labels Feb 23, 2025
Copy link

codspeed-hq bot commented Feb 23, 2025

CodSpeed Performance Report

Merging #6774 will degrade performances by 43.32%

Comparing dvladimirov:issues/6728 (759234f) with main (e82c218)

Summary

❌ 1 regressions
✅ 13 untouched benchmarks

⚠️ Please fix the performance issues or acknowledge them on CodSpeed.

Benchmarks breakdown

Benchmark BASE HEAD Change
test_build_flow_invalid_job_id 9.1 ms 16.1 ms -43.32%

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working size:M This PR changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Issue with reset-password API from the Users section of the API
1 participant