refactor(auth): Use user_id as JWT sub and implement get_user_by_id
Switched from username to user_id as the primary identifier in JWT tokens to better support external authentication providers. Added get_user_by_id to HistoryManager and updated API dependencies and tests to reflect these changes.
This commit is contained in:
@@ -25,6 +25,11 @@ def test_full_history_workflow(history_manager):
|
||||
assert user is not None
|
||||
assert user.display_name == "E2E User"
|
||||
|
||||
# 1.1 Verify get_user_by_id
|
||||
fetched_user = history_manager.get_user_by_id(user.id)
|
||||
assert fetched_user is not None
|
||||
assert fetched_user.username == email
|
||||
|
||||
# 2. Create Conversation
|
||||
conv = history_manager.create_conversation(user.id, "nj", "Test Analytics")
|
||||
assert conv.id is not None
|
||||
|
||||
Reference in New Issue
Block a user