mirror of https://github.com/openspug/spug
fix token ttl
parent
230d14644a
commit
85fa6d6e9f
|
@ -37,7 +37,7 @@ class AuthenticationMiddleware(MiddlewareMixin):
|
||||||
if user and user.token_expired >= time.time() and user.is_active:
|
if user and user.token_expired >= time.time() and user.is_active:
|
||||||
if x_real_ip == user.last_ip or AppSetting.get_default('bind_ip') is False:
|
if x_real_ip == user.last_ip or AppSetting.get_default('bind_ip') is False:
|
||||||
request.user = user
|
request.user = user
|
||||||
user.token_expired = time.time() + 8 * 60 * 60
|
user.token_expired = time.time() + settings.TOKEN_TTL
|
||||||
user.save()
|
user.save()
|
||||||
return None
|
return None
|
||||||
response = json_response(error="验证失败,请重新登录")
|
response = json_response(error="验证失败,请重新登录")
|
||||||
|
|
Loading…
Reference in New Issue