@sanvika/auth 1.0.12 → 1.0.14

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 +8 -6
  2. package/package.json +1 -1
package/dist/index.js CHANGED
@@ -172,9 +172,11 @@ function SanvikaAuthProvider({
172
172
  if (token) {
173
173
  fetch(`${iamUrl}/api/auth/logout`, {
174
174
  method: "POST",
175
- headers: { "Content-Type": "application/json" },
176
- body: JSON.stringify({ logout_all: false }),
177
- credentials: "include"
175
+ headers: {
176
+ "Content-Type": "application/json",
177
+ Authorization: `Bearer ${token}`
178
+ },
179
+ body: JSON.stringify({ logout_all: false })
178
180
  }).catch(() => {
179
181
  });
180
182
  }
@@ -512,7 +514,7 @@ function SanvikaAccountButton({
512
514
  /* @__PURE__ */ jsxs(
513
515
  "a",
514
516
  {
515
- href: "https://accounts.sanvikaproduction.com/dashboard/user-profile",
517
+ href: `https://accounts.sanvikaproduction.com/dashboard/user-profile?token=${encodeURIComponent(accessToken || "")}&origin=${encodeURIComponent(window.location.origin)}`,
516
518
  className: "snvk-dropdownItem",
517
519
  role: "menuitem",
518
520
  onClick: () => setDropdownOpen(false),
@@ -525,7 +527,7 @@ function SanvikaAccountButton({
525
527
  /* @__PURE__ */ jsxs(
526
528
  "a",
527
529
  {
528
- href: onboardingPath && user.status === "onboarding" ? onboardingPath : "https://accounts.sanvikaproduction.com/dashboard",
530
+ href: onboardingPath && user.status === "onboarding" ? onboardingPath : `https://accounts.sanvikaproduction.com/dashboard?token=${encodeURIComponent(accessToken || "")}&origin=${encodeURIComponent(window.location.origin)}`,
529
531
  className: "snvk-dropdownItem",
530
532
  role: "menuitem",
531
533
  onClick: () => setDropdownOpen(false),
@@ -540,7 +542,7 @@ function SanvikaAccountButton({
540
542
  {
541
543
  href: `https://accounts.sanvikaproduction.com/account/delete?token=${encodeURIComponent(
542
544
  accessToken || ""
543
- )}`,
545
+ )}&origin=${encodeURIComponent(window.location.origin)}`,
544
546
  className: "snvk-dropdownItem snvk-deleteItem",
545
547
  role: "menuitem",
546
548
  onClick: () => setDropdownOpen(false),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sanvika/auth",
3
- "version": "1.0.12",
3
+ "version": "1.0.14",
4
4
  "description": "Sanvika Auth SDK — React components and hooks for Sanvika SSO integration",
5
5
  "type": "module",
6
6
  "main": "dist/index.js",