Skip to content

Commit

Permalink
fix check auth
Browse files Browse the repository at this point in the history
  • Loading branch information
trim21 committed Sep 5, 2024
1 parent 08eeae3 commit bff5485
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
8 changes: 0 additions & 8 deletions server/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,14 +97,6 @@ def login() -> Redirect:
)


@router
@litestar.get("/debug")
async def debug_handler(request: Request) -> dict[str, Any]:
if not request.session:
return {}
return request.session


@router
@litestar.get("/oauth_callback")
async def callback(code: str, request: Request) -> Redirect:
Expand Down
4 changes: 4 additions & 0 deletions server/review.py
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,10 @@ async def __accept_patch(
)
return Redirect(f"/subject/{patch.id}")

if err_code == "TOKEN_INVALID":
request.set_session({session_key_back_to: f"/subject/{patch.id}"})
return Redirect("/login")

logger.error("failed to apply patch {!r}", data)
raise InternalServerException()

Expand Down

0 comments on commit bff5485

Please sign in to comment.