expire token after 15 min
All checks were successful
continuous-integration/drone Build is passing
continuous-integration/drone/push Build is passing

This commit is contained in:
Torma Kristóf 2020-11-27 06:04:46 +01:00
parent aab6e3e3cd
commit 791003f89e

View File

@ -8,6 +8,7 @@ __module_name__ = "loginapi"
__version__text__ = "1"
import uuid
from datetime import timedelta
import musicbrainzngs
from flask import request, current_app, abort
@ -43,7 +44,7 @@ class LoginApi(UserStoreResource):
self.encryptor.store(body)
token = str(uuid.uuid4())
flaskred.set(token, userobj['name'].encode('UTF-8'))
flaskred.expire(token, timedelta(minutes=15))
return {
'token': token
}, 200