fix: 🐛 authentication fixes for login and logout functionality#7
Merged
faizanazim11 merged 1 commit intomasterfrom Nov 12, 2025
Merged
Conversation
Contributor
There was a problem hiding this comment.
Pull Request Overview
This PR implements authentication fixes for login and logout functionality with dependency updates.
- Adds logout endpoint functionality with session token revocation
- Fixes short token generation to use random UUIDs instead of name-based UUIDs
- Updates OAuth2 scheme to not auto-error, allowing optional authentication
- Updates multiple dependencies including FastAPI, gRPC, Pydantic, and others
Reviewed Changes
Copilot reviewed 6 out of 7 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
src/tp_auth_serverside/db/memorydb/login.py |
Adds revoke_token function for session cleanup and fixes short token generation |
src/tp_auth_serverside/core/handler/authentication_handler.py |
Adds revoke_authentication method for logout flow |
src/tp_auth_serverside/core/fastapi_configurer.py |
Implements /logout route with optional custom handler support |
src/tp_auth_serverside/config.py |
Sets auto_error=False on OAuth2 scheme for optional authentication |
pyproject.toml |
Bumps version from 0.1.4 to 0.1.5 |
.pre-commit-config.yaml |
Updates ruff pre-commit hook from v0.13.0 to v0.14.4 |
uv.lock |
Updates multiple dependencies |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This pull request introduces a new logout functionality to the authentication utility, allowing users to revoke their authentication and remove session cookies. It also updates dependencies and makes improvements to token handling and configuration.
Authentication and Logout Enhancements
add_logout_routefunction infastapi_configurer.pyto provide a/logoutendpoint, which revokes authentication and deletes cookies. The route supports an optional handler for custom logout logic. (src/tp_auth_serverside/core/fastapi_configurer.py)src/tp_auth_serverside/core/fastapi_configurer.py) [1] [2]revoke_authenticationinAuthenticationHandlerto call the newrevoke_tokenfunction and clear session cookies. (src/tp_auth_serverside/core/handler/authentication_handler.py)revoke_tokento the memory DB login module to support token revocation for a specific user and token. (src/tp_auth_serverside/db/memorydb/login.py)Token Handling Improvements
set_tokento use a random UUID instead of a name-based UUID for better uniqueness. (src/tp_auth_serverside/db/memorydb/login.py)Dependency and Configuration Updates
ruff-pre-commithook version in.pre-commit-config.yamlfor linting improvements. (.pre-commit-config.yaml)0.1.5inpyproject.toml. (pyproject.toml)auto_error=Falsefor the OAuth2 scheme to allow more flexible error handling during authentication. (src/tp_auth_serverside/config.py)