@goweekdays/core 2.11.9 → 2.11.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.mjs CHANGED
@@ -466,7 +466,10 @@ function useAuthService() {
466
466
  if (!isPasswordValid) {
467
467
  throw new BadRequestError2("Invalid password");
468
468
  }
469
- const { setCache } = useCache2(`user:${_user._id?.toString()}`);
469
+ const { setCache, delNamespace } = useCache2(
470
+ `user:${_user._id?.toString()}`
471
+ );
472
+ await delNamespace();
470
473
  const sid = v4_default();
471
474
  const cacheKey = `sid:${sid}`;
472
475
  await setCache(cacheKey, _user, 14400);
@@ -11200,7 +11203,7 @@ function useAuthController() {
11200
11203
  }
11201
11204
  }
11202
11205
  async function logout(req, res, next) {
11203
- const user = req.headers["user"] ?? "";
11206
+ const user = req.cookies.user;
11204
11207
  if (!user) {
11205
11208
  next(new BadRequestError50("Failed to identify user from request."));
11206
11209
  return;