mirror of
https://git.sr.ht/~tsileo/microblog.pub
synced 2024-12-22 21:24:28 +00:00
Fixes
This commit is contained in:
parent
fb6a08426f
commit
17b1779d82
1 changed files with 3 additions and 3 deletions
6
app.py
6
app.py
|
@ -2208,7 +2208,7 @@ def indieauth_endpoint():
|
||||||
print(code, redirect_uri, client_id)
|
print(code, redirect_uri, client_id)
|
||||||
|
|
||||||
# Ensure the code is recent
|
# Ensure the code is recent
|
||||||
if (datetime.now() - datetime.fromtimetamp(auth["ts"])) > timedelta(minutes=5):
|
if (datetime.now() - datetime.fromtimestamp(auth["ts"])) > timedelta(minutes=5):
|
||||||
abort(400)
|
abort(400)
|
||||||
|
|
||||||
if not auth:
|
if not auth:
|
||||||
|
@ -2247,7 +2247,7 @@ def token_endpoint():
|
||||||
|
|
||||||
now = datetime.now()
|
now = datetime.now()
|
||||||
# Ensure the code is recent
|
# Ensure the code is recent
|
||||||
if (now - datetime.fromtimetamp(auth["ts"])) > timedelta(minutes=5):
|
if (now - datetime.fromtimestamp(auth["ts"])) > timedelta(minutes=5):
|
||||||
abort(400)
|
abort(400)
|
||||||
|
|
||||||
scope = auth["scope"].split()
|
scope = auth["scope"].split()
|
||||||
|
@ -2275,7 +2275,7 @@ def token_endpoint():
|
||||||
abort(403)
|
abort(403)
|
||||||
|
|
||||||
# Check the token expritation (valid for 3 hours)
|
# Check the token expritation (valid for 3 hours)
|
||||||
if (datetime.now() - datetime.fromtimetamp(payload["ts"])) > timedelta(minutes=180):
|
if (datetime.now() - datetime.fromtimestamp(payload["ts"])) > timedelta(minutes=180):
|
||||||
abort(401)
|
abort(401)
|
||||||
|
|
||||||
return build_auth_resp(
|
return build_auth_resp(
|
||||||
|
|
Loading…
Reference in a new issue