Skip to content

Commit

Permalink
pass tests
Browse files Browse the repository at this point in the history
  • Loading branch information
mradigen committed Jan 25, 2024
1 parent 0fe877b commit 65b4f4d
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
3 changes: 1 addition & 2 deletions src/pwncore/routes/auth.py
Original file line number Diff line number Diff line change
Expand Up @@ -96,8 +96,7 @@ async def team_login(team_data: AuthBody, response: Response):
return {"msg_code": config.msg_codes["wrong_password"]}

current_time = datetime.datetime.utcnow()
expiration_time = current_time + \
datetime.timedelta(hours=config.jwt_valid_duration)
expiration_time = current_time + datetime.timedelta(hours=config.jwt_valid_duration)
token_payload = {"team_id": team.id, "exp": expiration_time}
token = jwt.encode(token_payload, config.jwt_secret, algorithm="HS256")

Expand Down
4 changes: 3 additions & 1 deletion src/pwncore/routes/ctf/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,9 @@ async def flag_post(
)
if check_solved:
hints = await Hint.filter(
problem_id=ctf_id, viewedhints__team_id=team_id, viewedhints__with_points=True
problem_id=ctf_id,
viewedhints__team_id=team_id,
viewedhints__with_points=True,
)
pnlt = (100 - sum(map(lambda h: HINTPENALTY[h.order], hints))) / 100

Expand Down
1 change: 1 addition & 0 deletions src/pwncore/routes/ctf/start.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
router = APIRouter(tags=["ctf"])
logger = getLogger(__name__)


@atomic()
@router.post("/{ctf_id}/start")
async def start_docker_container(ctf_id: int, response: Response, jwt: RequireJwt):
Expand Down

0 comments on commit 65b4f4d

Please sign in to comment.