@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/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # @goweekdays/core
2
2
 
3
+ ## 2.11.10
4
+
5
+ ### Patch Changes
6
+
7
+ - 4c31cef: Update logout to use cookie and clear user sessions
8
+
3
9
  ## 2.11.9
4
10
 
5
11
  ### Patch Changes
package/dist/index.js CHANGED
@@ -633,7 +633,10 @@ function useAuthService() {
633
633
  if (!isPasswordValid) {
634
634
  throw new import_utils2.BadRequestError("Invalid password");
635
635
  }
636
- const { setCache } = (0, import_utils2.useCache)(`user:${_user._id?.toString()}`);
636
+ const { setCache, delNamespace } = (0, import_utils2.useCache)(
637
+ `user:${_user._id?.toString()}`
638
+ );
639
+ await delNamespace();
637
640
  const sid = v4_default();
638
641
  const cacheKey = `sid:${sid}`;
639
642
  await setCache(cacheKey, _user, 14400);
@@ -11173,7 +11176,7 @@ function useAuthController() {
11173
11176
  }
11174
11177
  }
11175
11178
  async function logout(req, res, next) {
11176
- const user = req.headers["user"] ?? "";
11179
+ const user = req.cookies.user;
11177
11180
  if (!user) {
11178
11181
  next(new import_utils54.BadRequestError("Failed to identify user from request."));
11179
11182
  return;