Fix not generating a new state

This commit is contained in:
Nexus 2023-04-09 22:04:05 +01:00
parent e9dd1160fe
commit 31714b50f7
Signed by: nex
GPG key ID: 0FA334385D0B689F

View file

@ -77,6 +77,7 @@ async def authenticate(req: Request, code: str = None, state: str = None):
if (datetime.now() - app.state.states[_value]).total_seconds() > 300: if (datetime.now() - app.state.states[_value]).total_seconds() > 300:
del app.state.states[_value] del app.state.states[_value]
removed += 1 removed += 1
value = os.urandom(4).hex()
print(f"Removed {removed} states.", file=sys.stderr) print(f"Removed {removed} states.", file=sys.stderr)
if value in app.state.states: if value in app.state.states: