New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@descope/react-sdk

Package Overview
Dependencies
Maintainers
4
Versions
619
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@descope/react-sdk - npm Package Compare versions

Comparing version 0.0.52-alpha.1 to 0.0.52-alpha.2

1

dist/index.d.ts

@@ -48,2 +48,3 @@ import React, { DOMAttributes, FC } from 'react';

user: User;
sessionToken: string;
};

@@ -50,0 +51,0 @@

2

dist/index.js

@@ -1,1 +0,1 @@

import e,{useMemo as r,useRef as t,useImperativeHandle as o,useCallback as s,useEffect as n,useState as c}from"react";import"@descope/web-component";const d=e.createContext(void 0),u=()=>{const t=e.useContext(d);if(!t)throw Error("You can only use useAuth in the context of <AuthProvider />");const{authenticated:o,user:s,projectId:n,baseUrl:c}=t;return r((()=>({projectId:n,baseUrl:c,authenticated:o,user:s})),[n,c,o,s])},a=e.forwardRef((({flowId:r,onSuccess:c,onError:u},a)=>{const i=t();o(a,(()=>i.current));const{projectId:l,baseUrl:p,setAuthenticated:v,setUser:h}=e.useContext(d),f=s((e=>{h(e?.detail?.user),v(!0),c&&c(e)}),[h,v,c]);return n((()=>{const e=i.current;return e?.addEventListener("success",f),u&&e?.addEventListener("error",u),()=>{u&&e?.removeEventListener("error",u),e?.removeEventListener("success",f)}}),[i,u,f]),e.createElement("descope-wc",{"project-id":l,"flow-id":r,"base-url":p,ref:i})}));a.defaultProps={onError:void 0,onSuccess:void 0};const i=({projectId:t,baseUrl:o,children:s})=>{const[n,u]=c(!1),[a,i]=c({}),l=r((()=>({user:a,authenticated:n,projectId:t,baseUrl:o,setUser:i,setAuthenticated:u})),[n,a,t,o]);return e.createElement(d.Provider,{value:l},s)};i.defaultProps={baseUrl:"",children:void 0};export{i as AuthProvider,a as Descope,u as useAuth};
import e,{useMemo as t,useRef as r,useImperativeHandle as s,useCallback as o,useEffect as n,useState as c}from"react";import"@descope/web-component";const d=e.createContext(void 0),i=()=>{const r=e.useContext(d);if(!r)throw Error("You can only use useAuth in the context of <AuthProvider />");const{projectId:s,baseUrl:o,authenticated:n,user:c,sessionToken:i}=r;return t((()=>({projectId:s,baseUrl:o,authenticated:n,user:c,sessionToken:i})),[s,o,n,c,i])},u=e.forwardRef((({flowId:t,onSuccess:c,onError:i},u)=>{const a=r();s(u,(()=>a.current));const{projectId:l,baseUrl:p,setAuthenticated:v,setUser:h,setSessionToken:f}=e.useContext(d),E=o((e=>{h(e.detail?.user),v(!0),f(e.detail?.sessionJwt),c&&c(e)}),[h,v,c]);return n((()=>{const e=a.current;return e?.addEventListener("success",E),i&&e?.addEventListener("error",i),()=>{i&&e?.removeEventListener("error",i),e?.removeEventListener("success",E)}}),[a,i,E]),e.createElement("descope-wc",{"project-id":l,"flow-id":t,"base-url":p,ref:a})}));u.defaultProps={onError:void 0,onSuccess:void 0};const a=({projectId:r,baseUrl:s,children:o})=>{const[n,i]=c(!1),[u,a]=c({}),[l,p]=c(""),v=t((()=>({projectId:r,baseUrl:s,user:u,authenticated:n,sessionToken:l,setUser:a,setAuthenticated:i,setSessionToken:p})),[n,u,r,s]);return e.createElement(d.Provider,{value:v},o)};a.defaultProps={baseUrl:"",children:void 0};export{a as AuthProvider,u as Descope,i as useAuth};
{
"name": "@descope/react-sdk",
"version": "0.0.52-alpha.1",
"version": "0.0.52-alpha.2",
"main": "dist/index.js",

@@ -16,3 +16,3 @@ "types": "dist/index.d.ts",

"dependencies": {
"@descope/web-component": "^0.0.26-alpha.2"
"@descope/web-component": "^0.0.26-alpha.3"
},

@@ -19,0 +19,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc