@sanvika/auth 1.0.14 → 1.0.15

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.
Files changed (2) hide show
  1. package/dist/index.js +6 -9
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -45,15 +45,12 @@ async function ensureTokenFresh(token, thresholdSeconds = 300) {
45
45
  return token;
46
46
  }
47
47
  try {
48
- const refreshRes = await fetch(
49
- `${process.env.NEXT_PUBLIC_APP_BASE_URL || "https://accounts.sanvikaproduction.com"}/api/auth/refresh`,
50
- {
51
- method: "POST",
52
- headers: { "Content-Type": "application/json" },
53
- credentials: "include"
54
- // Send refresh token cookie
55
- }
56
- );
48
+ const refreshRes = await fetch("/api/auth/refresh", {
49
+ method: "POST",
50
+ headers: { "Content-Type": "application/json" },
51
+ credentials: "include"
52
+ // Send httpOnly refresh token cookie (same domain)
53
+ });
57
54
  if (!refreshRes.ok) {
58
55
  console.warn("[TokenRefresh] Refresh failed:", refreshRes.status);
59
56
  return token;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanvika/auth",
3
- "version": "1.0.14",
3
+ "version": "1.0.15",
4
4
  "description": "Sanvika Auth SDK — React components and hooks for Sanvika SSO integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",