fix: sessionKey

This commit is contained in:
2024-03-09 15:15:54 +00:00
parent 99238636e6
commit 554588fb42
2 changed files with 4 additions and 4 deletions
@@ -3,7 +3,7 @@ import { StartSession } from "@sammo/server_util";
import { POST, type APIReturnType } from "@strpc/express";
import { declProcDecorators } from "@strpc/express/proc_decorator";
import { z } from "zod";
import { loginCtxSessionKey, type GatewayLoginCtx } from "@/procDecorator/ReqGatewayLogin.js";
import { gatewayLoginCtxSessionKey, type GatewayLoginCtx } from "@/procDecorator/ReqGatewayLogin.js";
import { delay } from "@sammo/util";
type BaseAPI = typeof structure.Login.LoginByID;
@@ -52,7 +52,7 @@ export const LoginByID = POST<BaseAPI>(LoginByIDReq)(declProcDecorators(
loginDate: new Date(),
}
ctx.session.setItem(loginCtxSessionKey, loginCtx);
ctx.session.setItem(gatewayLoginCtxSessionKey, loginCtx);
return {
@@ -3,7 +3,7 @@ import { StartSession } from "@sammo/server_util";
import { POST, type APIReturnType } from "@strpc/express";
import { declProcDecorators } from "@strpc/express/proc_decorator";
import { z } from "zod";
import { loginCtxSessionKey, type GatewayLoginCtx } from "@/procDecorator/ReqGatewayLogin.js";
import { gatewayLoginCtxSessionKey, type GatewayLoginCtx } from "@/procDecorator/ReqGatewayLogin.js";
import { delay } from "@sammo/util";
type BaseAPI = typeof structure.Login.LoginByToken;
@@ -38,7 +38,7 @@ export const LoginByToken = POST<BaseAPI>(LoginByTokenReq)(declProcDecorators(
loginDate: new Date(),
}
ctx.session.setItem(loginCtxSessionKey, loginCtx);
ctx.session.setItem(gatewayLoginCtxSessionKey, loginCtx);
//throw new Error("Method not implemented.");