Skip to content

Commit

Permalink
Minor
Browse files Browse the repository at this point in the history
  • Loading branch information
snwagh committed Sep 9, 2024
1 parent f418c3a commit d2d07cf
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 6 deletions.
6 changes: 3 additions & 3 deletions notebooks/scenarios/bigquery/011-users-emails-passwords.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -498,7 +498,7 @@
"outputs": [],
"source": [
"# Variable is poorly named, token expiration time is in seconds and not minutes\n",
"high_client.api.services.settings.update(pwd_token_config={\"token_exp_min\": 5})\n",
"high_client.api.services.settings.update(pwd_token_config={\"token_exp_min\": 3})\n",
"high_client.refresh()"
]
},
Expand All @@ -519,8 +519,8 @@
"metadata": {},
"outputs": [],
"source": [
"# Wait 10 seconds\n",
"await asyncio.sleep(5)"
"# Wait 3 seconds to ensure token expires\n",
"await asyncio.sleep(3)"
]
},
{
Expand Down
4 changes: 1 addition & 3 deletions packages/syft/src/syft/service/user/user_service.py
Original file line number Diff line number Diff line change
Expand Up @@ -267,9 +267,7 @@ def reset_password(
)

# If token expired
expiration_time = (
root_context.server.settings.pwd_token_config.token_exp_seconds
)
expiration_time = root_context.server.settings.pwd_token_config.token_exp_min
if time_difference > timedelta(seconds=expiration_time):
raise SyftException(
public_message="Failed to reset user password. Token is invalid or expired."
Expand Down

0 comments on commit d2d07cf

Please sign in to comment.