expire token after 15 min
This commit is contained in:
parent
aab6e3e3cd
commit
791003f89e
@ -8,6 +8,7 @@ __module_name__ = "loginapi"
|
|||||||
__version__text__ = "1"
|
__version__text__ = "1"
|
||||||
|
|
||||||
import uuid
|
import uuid
|
||||||
|
from datetime import timedelta
|
||||||
|
|
||||||
import musicbrainzngs
|
import musicbrainzngs
|
||||||
from flask import request, current_app, abort
|
from flask import request, current_app, abort
|
||||||
@ -43,7 +44,7 @@ class LoginApi(UserStoreResource):
|
|||||||
self.encryptor.store(body)
|
self.encryptor.store(body)
|
||||||
token = str(uuid.uuid4())
|
token = str(uuid.uuid4())
|
||||||
flaskred.set(token, userobj['name'].encode('UTF-8'))
|
flaskred.set(token, userobj['name'].encode('UTF-8'))
|
||||||
|
flaskred.expire(token, timedelta(minutes=15))
|
||||||
return {
|
return {
|
||||||
'token': token
|
'token': token
|
||||||
}, 200
|
}, 200
|
||||||
|
Loading…
Reference in New Issue
Block a user