Skip to content

Commit

Permalink
2024年11月13日 关闭根域cookie
Browse files Browse the repository at this point in the history
  • Loading branch information
ss1917 committed Nov 13, 2024
1 parent 94db2e2 commit 27d8bd0
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions mg/handlers/login_v5_handler.py
Original file line number Diff line number Diff line change
Expand Up @@ -99,21 +99,21 @@ async def post(self, *args, **kwargs):
if mfa_key:
self.set_cookie("mfa_key", mfa_key, expires_days=1, httponly=True)

if c_url:
try:
root_domain = self.request.headers.get('Codo-root-domain')
self.set_cookie("auth_key", auth_key, domain=root_domain, expires_days=1)
self.set_cookie("is_login", 'yes', domain=root_domain, expires_days=1)
logging.info(f"设置主域Cookie {root_domain}")
except Exception as err:
logging.error(f"设置主域cookie失败 {err}")

# if c_url:
# try:
# root_domain = self.request.headers.get('Codo-root-domain')
# self.set_cookie("auth_key", auth_key, domain=root_domain, expires_days=1)
# self.set_cookie("is_login", 'yes', domain=root_domain, expires_days=1)
# logging.info(f"设置主域Cookie {root_domain}")
# except Exception as err:
# logging.error(f"设置主域cookie失败 {err}")
#
real_login_dict = dict(code=0, msg='登录成功',
username=user_info.username,
nickname=user_info.nickname,
auth_key=auth_key,
avatar=user_info.avatar,
c_url=c_url,
# username=user_info.username,
# nickname=user_info.nickname,
# auth_key=auth_key,
# avatar=user_info.avatar,
# c_url=c_url,
data=dict(username=user_info.username, nickname=user_info.nickname, auth_key=auth_key,
avatar=user_info.avatar, c_url=c_url))
return self.write(real_login_dict)
Expand Down

0 comments on commit 27d8bd0

Please sign in to comment.