@eaccess/auth 0.1.14 → 0.1.16

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.cjs CHANGED
@@ -1767,13 +1767,20 @@ var AuthManager = class {
1767
1767
  }
1768
1768
  setRememberCookie(token, expires) {
1769
1769
  const cookieName = this.config.rememberCookieName || "remember_token";
1770
+ const cookieConfig = this.config.cookie || {};
1770
1771
  if (token === null) {
1771
- this.res.clearCookie(cookieName);
1772
+ this.res.clearCookie(cookieName, {
1773
+ domain: cookieConfig.domain,
1774
+ secure: cookieConfig.secure ?? this.req.secure,
1775
+ sameSite: cookieConfig.sameSite
1776
+ });
1772
1777
  } else {
1773
1778
  this.res.cookie(cookieName, token, {
1774
1779
  expires,
1775
1780
  httpOnly: true,
1776
- secure: this.req.secure
1781
+ secure: cookieConfig.secure ?? this.req.secure,
1782
+ domain: cookieConfig.domain,
1783
+ sameSite: cookieConfig.sameSite
1777
1784
  });
1778
1785
  }
1779
1786
  }