@whimslab/auth
Advanced tools
Comparing version 0.0.23 to 0.0.24
{ | ||
"name": "@whimslab/auth", | ||
"version": "0.0.23", | ||
"version": "0.0.24", | ||
"description": "WhimsBuilder user authentication utilities", | ||
@@ -5,0 +5,0 @@ "main": "./runtime-auth.umd.js", |
@@ -45,3 +45,3 @@ import { writable as o } from "svelte/store"; | ||
function f(t, s) { | ||
return fetch("/api/auth/reset-password", { | ||
return fetch("/api/auth/resetPassword", { | ||
method: "POST", | ||
@@ -48,0 +48,0 @@ headers: { |
@@ -1,1 +0,1 @@ | ||
(function(t,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("svelte/store")):typeof define=="function"&&define.amd?define(["exports","svelte/store"],n):(t=typeof globalThis<"u"?globalThis:t||self,n(t["runtime-auth"]={},t.store))})(this,function(t,n){"use strict";async function u(e){i.set(void 0),console.log("Fetching user profile");try{a.set(!0);const s=await fetch("/api/auth/profile");if(s.status===200){const r=await s.json();e&&e(r)}else{const r=await s.json();i.set(r),o.set(void 0)}}finally{a.set(!1)}}async function d(){const e=await fetch("/api/auth/signout",{method:"POST"});if(e.status===200)return o.set(void 0),await e.json();throw Error(`Unable to signout: ${e.status}, ${await e.json()}`)}const i=n.writable(void 0),a=n.writable(!1),o=n.writable(null,e=>(u(s=>{console.log("Setting user store:",s),e(s)}),()=>{}));async function l(){return await u(s=>{console.log("Resetting user store:",s),o.set(s)})}function f(e){return fetch("/api/auth/sendResetPasswordEmail",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})})}function c(e,s){return fetch("/api/auth/reset-password",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:e,token:s})})}t.error=i,t.loading=a,t.reloadUser=l,t.resetPassword=c,t.sendResetPasswordEmail=f,t.signout=d,t.user=o,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); | ||
(function(t,n){typeof exports=="object"&&typeof module<"u"?n(exports,require("svelte/store")):typeof define=="function"&&define.amd?define(["exports","svelte/store"],n):(t=typeof globalThis<"u"?globalThis:t||self,n(t["runtime-auth"]={},t.store))})(this,function(t,n){"use strict";async function u(e){i.set(void 0),console.log("Fetching user profile");try{a.set(!0);const s=await fetch("/api/auth/profile");if(s.status===200){const r=await s.json();e&&e(r)}else{const r=await s.json();i.set(r),o.set(void 0)}}finally{a.set(!1)}}async function d(){const e=await fetch("/api/auth/signout",{method:"POST"});if(e.status===200)return o.set(void 0),await e.json();throw Error(`Unable to signout: ${e.status}, ${await e.json()}`)}const i=n.writable(void 0),a=n.writable(!1),o=n.writable(null,e=>(u(s=>{console.log("Setting user store:",s),e(s)}),()=>{}));async function l(){return await u(s=>{console.log("Resetting user store:",s),o.set(s)})}function f(e){return fetch("/api/auth/sendResetPasswordEmail",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({url:e})})}function c(e,s){return fetch("/api/auth/resetPassword",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({password:e,token:s})})}t.error=i,t.loading=a,t.reloadUser=l,t.resetPassword=c,t.sendResetPasswordEmail=f,t.signout=d,t.user=o,Object.defineProperties(t,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})}); |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3470