Skip to content

Commit

Permalink
linter ignore type check on api_jwt_auth.current_user
Browse files Browse the repository at this point in the history
  • Loading branch information
babebe committed Nov 22, 2024
1 parent b2a9ae1 commit 28fc586
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions api/src/api/users/user_routes.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
from src.api.route_utils import raise_flask_error
from src.api.users import user_schemas
from src.api.users.user_blueprint import user_blueprint
from src.api.users.user_schemas import LogoutResponseSchema
from src.api.users.user_schemas import UserTokenLogoutResponseSchema
from src.auth.api_jwt_auth import api_jwt_auth
from src.auth.api_key_auth import api_key_auth
from src.db.models.user_models import UserTokenSession
Expand Down Expand Up @@ -42,14 +42,14 @@ def user_token(x_oauth_login_gov: dict) -> response.ApiResponse:


@user_blueprint.post("/token/logout")
@user_blueprint.output(LogoutResponseSchema)
@user_blueprint.output(UserTokenLogoutResponseSchema)
@user_blueprint.doc(responses=[200, 401])
@user_blueprint.auth_required(api_jwt_auth)
@flask_db.with_db_session()
def user_token_logout(db_session: db.Session) -> response.ApiResponse:
logger.info("POST /v1/users/token/logout")

user_token_session: UserTokenSession = api_jwt_auth.get("current_user")
user_token_session: UserTokenSession = api_jwt_auth.current_user # type: ignore
with db_session.begin():
user_token_session.is_valid = False
db_session.add(user_token_session)
Expand Down

0 comments on commit 28fc586

Please sign in to comment.