ongeki: fix frontend versions

This commit is contained in:
2024-06-09 03:14:43 -04:00
committed by beerpsi
parent 560de25d49
commit 346ea41db4
4 changed files with 185 additions and 22 deletions

View File

@ -169,7 +169,7 @@ class FE_Base():
), media_type="text/html; charset=utf-8")
if sesh is None:
resp.delete_cookie("DIANA_SESH")
resp.delete_cookie("ARTEMIS_SESH")
return resp
def get_routes(self) -> List[Route]:
@ -194,6 +194,7 @@ class FE_Base():
sesh.permissions = tk['permissions']
sesh.chunithm_version = tk['chunithm_version']
sesh.maimai_version = tk['maimai_version']
sesh.ongeki_version = tk['ongeki_version']
if sesh.user_id <= 0:
self.logger.error("User session failed to validate due to an invalid ID!")
@ -219,7 +220,7 @@ class FE_Base():
return UserSession()
def validate_session(self, request: Request) -> Optional[UserSession]:
sesh = request.cookies.get('DIANA_SESH', "")
sesh = request.cookies.get('ARTEMIS_SESH', "")
if not sesh:
return None
@ -280,7 +281,7 @@ class FE_Gate(FE_Base):
error=err,
sesh=vars(UserSession()),
), media_type="text/html; charset=utf-8")
resp.delete_cookie("DIANA_SESH")
resp.delete_cookie("ARTEMIS_SESH")
return resp
async def render_login(self, request: Request):
@ -330,7 +331,7 @@ class FE_Gate(FE_Base):
usr_sesh = self.encode_session(sesh)
self.logger.debug(f"Created session with JWT {usr_sesh}")
resp = RedirectResponse("/user/", 303)
resp.set_cookie("DIANA_SESH", usr_sesh)
resp.set_cookie("ARTEMIS_SESH", usr_sesh)
return resp
@ -369,7 +370,7 @@ class FE_Gate(FE_Base):
usr_sesh = self.encode_session(sesh)
self.logger.debug(f"Created session with JWT {usr_sesh}")
resp = RedirectResponse("/user/", 303)
resp.set_cookie("DIANA_SESH", usr_sesh)
resp.set_cookie("ARTEMIS_SESH", usr_sesh)
return resp
@ -487,7 +488,7 @@ class FE_User(FE_Base):
async def render_logout(self, request: Request):
resp = RedirectResponse("/gate/", 303)
resp.delete_cookie("DIANA_SESH")
resp.delete_cookie("ARTEMIS_SESH")
return resp
async def edit_card(self, request: Request) -> RedirectResponse: