forked from Hay1tsme/artemis
ongeki: fix frontend versions
This commit is contained in:
@ -193,7 +193,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]:
|
||||
@ -218,6 +218,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!")
|
||||
@ -243,7 +244,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
|
||||
|
||||
@ -304,7 +305,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):
|
||||
@ -354,7 +355,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
|
||||
|
||||
@ -393,7 +394,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
|
||||
|
||||
@ -511,7 +512,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:
|
||||
@ -895,7 +896,7 @@ class FE_Machine(FE_Base):
|
||||
arcade={}
|
||||
), media_type="text/html; charset=utf-8")
|
||||
|
||||
cfg_dir = environ.get("DIANA_CFG_DIR", "config")
|
||||
cfg_dir = environ.get("ARTEMIS_CFG_DIR", "config")
|
||||
cfg: CoreConfig = CoreConfig()
|
||||
if path.exists(f"{cfg_dir}/core.yaml"):
|
||||
cfg.update(yaml.safe_load(open(f"{cfg_dir}/core.yaml")))
|
||||
|
Reference in New Issue
Block a user