INNER CODE UNIT · Python
refresh_endpoint
fescobar/allure-docker-service · allure-docker-api/app.py:665
def refresh_endpoint():
if ENABLE_SECURITY_LOGIN is False:
body = {
'meta_data': {
'message' : 'SECURITY is not enabled'
}
}
resp = jsonify(body)
return resp, 404
try:
username = get_jwt_identity()
access_token = create_access_token(identity=username)
access_token_expires = app.config['JWT_ACCESS_TOKEN_EXPIRES']
expires_in = access_token_expires.total_seconds() if access_token_expires else 0
json_body = {
'data': {
'access_token': access_token,
'expires_in': expires_in,