@quiltt/react 4.3.2 → 4.3.3
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/CHANGELOG.md +9 -0
- package/dist/{QuilttAuthProvider-12s-D-Wr7LUT.js → QuilttAuthProvider-12s-4hQ7iysR.js} +4 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.js +5 -5
- package/dist/{useQuilttConnector-12s-BJljrsWT.js → useQuilttConnector-12s-DTl-EiqV.js} +3 -3
- package/dist/{useQuilttInstitutions-12s-PJd2C3BF.js → useQuilttInstitutions-12s-Cg4OA77c.js} +1 -1
- package/dist/{useQuilttSession-12s-CwVw-aOM.js → useQuilttSession-12s-BCq3OL9S.js} +1 -1
- package/package.json +2 -2
- package/src/hooks/session/useIdentifySession.ts +5 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
# @quiltt/react
|
|
2
2
|
|
|
3
|
+
## 4.3.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- [#375](https://github.com/quiltt/quiltt-js/pull/375) [`fdc91e3`](https://github.com/quiltt/quiltt-js/commit/fdc91e3efb3f63659580f2d1d2ea0ff7fcaee8f5) Thanks [@sirwolfgang](https://github.com/sirwolfgang)! - Add 403 callback to Auth useIdentifySession
|
|
8
|
+
|
|
9
|
+
- Updated dependencies [[`fdc91e3`](https://github.com/quiltt/quiltt-js/commit/fdc91e3efb3f63659580f2d1d2ea0ff7fcaee8f5)]:
|
|
10
|
+
- @quiltt/core@4.3.3
|
|
11
|
+
|
|
3
12
|
## 4.3.2
|
|
4
13
|
|
|
5
14
|
### Patch Changes
|
|
@@ -7,7 +7,7 @@ import './useSession-12s-7GOn4sUn.js';
|
|
|
7
7
|
import 'use-debounce';
|
|
8
8
|
import { jsx } from 'react/jsx-runtime';
|
|
9
9
|
import { ApolloProvider } from '@apollo/client/react/context/ApolloProvider.js';
|
|
10
|
-
import { u as useQuilttSession } from './useQuilttSession-12s-
|
|
10
|
+
import { u as useQuilttSession } from './useQuilttSession-12s-BCq3OL9S.js';
|
|
11
11
|
|
|
12
12
|
const useAuthenticateSession = (auth, setSession)=>{
|
|
13
13
|
const authenticateSession = useCallback(async (payload, callbacks)=>{
|
|
@@ -44,6 +44,9 @@ const useIdentifySession = (auth, setSession)=>{
|
|
|
44
44
|
case 202:
|
|
45
45
|
if (callbacks.onChallenged) return callbacks.onChallenged();
|
|
46
46
|
break;
|
|
47
|
+
case 403:
|
|
48
|
+
if (callbacks.onForbidden) return callbacks.onForbidden();
|
|
49
|
+
break;
|
|
47
50
|
case 422:
|
|
48
51
|
if (callbacks.onError) return callbacks.onError(response.data);
|
|
49
52
|
break;
|
package/dist/index.d.ts
CHANGED
|
@@ -94,6 +94,7 @@ type IdentifySessionCallbacks = {
|
|
|
94
94
|
onSuccess?: () => unknown;
|
|
95
95
|
onChallenged?: () => unknown;
|
|
96
96
|
onError?: (errors: UnprocessableData) => unknown;
|
|
97
|
+
onForbidden?: () => unknown;
|
|
97
98
|
};
|
|
98
99
|
type IdentifySession = (payload: UsernamePayload, callbacks: IdentifySessionCallbacks) => Promise<unknown>;
|
|
99
100
|
type UseIdentifySession = (auth: AuthAPI, setSession: SetSession) => IdentifySession;
|
package/dist/index.js
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
export * from '@quiltt/core';
|
|
2
2
|
import { jsx } from 'react/jsx-runtime';
|
|
3
3
|
import { useRef, useEffect } from 'react';
|
|
4
|
-
import { u as useQuilttConnector } from './useQuilttConnector-12s-
|
|
5
|
-
import { i as isDeepEqual, Q as QuilttAuthProvider } from './QuilttAuthProvider-12s-
|
|
6
|
-
export { b as useAuthenticateSession, a as useIdentifySession, u as useImportSession, c as useRevokeSession } from './QuilttAuthProvider-12s-
|
|
4
|
+
import { u as useQuilttConnector } from './useQuilttConnector-12s-DTl-EiqV.js';
|
|
5
|
+
import { i as isDeepEqual, Q as QuilttAuthProvider } from './QuilttAuthProvider-12s-4hQ7iysR.js';
|
|
6
|
+
export { b as useAuthenticateSession, a as useIdentifySession, u as useImportSession, c as useRevokeSession } from './QuilttAuthProvider-12s-4hQ7iysR.js';
|
|
7
7
|
export { u as useEventListener } from './useEventListener-12s-D_-6QIXa.js';
|
|
8
8
|
export { u as useIsomorphicLayoutEffect } from './useIsomorphicLayoutEffect-12s-DeTHOKz1.js';
|
|
9
9
|
export { u as useQuilttClient } from './useQuilttClient-12s-CAAUait1.js';
|
|
10
|
-
export { u as useQuilttInstitutions } from './useQuilttInstitutions-12s-
|
|
11
|
-
export { u as useQuilttSession } from './useQuilttSession-12s-
|
|
10
|
+
export { u as useQuilttInstitutions } from './useQuilttInstitutions-12s-Cg4OA77c.js';
|
|
11
|
+
export { u as useQuilttSession } from './useQuilttSession-12s-BCq3OL9S.js';
|
|
12
12
|
export { u as useQuilttSettings } from './useQuilttSettings-12s--rCJoNHD.js';
|
|
13
13
|
export { u as useSession } from './useSession-12s-7GOn4sUn.js';
|
|
14
14
|
export { u as useStorage } from './useStorage-12s-DHcq3Kuh.js';
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useState, useRef, useEffect, useCallback } from 'react';
|
|
3
3
|
import { cdnBase } from '@quiltt/core';
|
|
4
|
-
import { u as useQuilttSession } from './useQuilttSession-12s-
|
|
4
|
+
import { u as useQuilttSession } from './useQuilttSession-12s-BCq3OL9S.js';
|
|
5
5
|
import { u as useScript } from './useScript-12s-JCgaTW9n.js';
|
|
6
|
-
import { i as isDeepEqual } from './QuilttAuthProvider-12s-
|
|
6
|
+
import { i as isDeepEqual } from './QuilttAuthProvider-12s-4hQ7iysR.js';
|
|
7
7
|
|
|
8
|
-
var version = "4.3.
|
|
8
|
+
var version = "4.3.3";
|
|
9
9
|
|
|
10
10
|
const useQuilttConnector = (connectorId, options)=>{
|
|
11
11
|
const status = useScript(`${cdnBase}/v1/connector.js?agent=react-${version}`, {
|
package/dist/{useQuilttInstitutions-12s-PJd2C3BF.js → useQuilttInstitutions-12s-Cg4OA77c.js}
RENAMED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { useMemo, useState, useRef, useEffect, useCallback } from 'react';
|
|
3
3
|
import { InstitutionsAPI } from '@quiltt/core';
|
|
4
4
|
import { useDebounce } from 'use-debounce';
|
|
5
|
-
import { v as version } from './useQuilttConnector-12s-
|
|
5
|
+
import { v as version } from './useQuilttConnector-12s-DTl-EiqV.js';
|
|
6
6
|
import { u as useSession } from './useSession-12s-7GOn4sUn.js';
|
|
7
7
|
|
|
8
8
|
const useQuilttInstitutions = (connectorId, onErrorCallback)=>{
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
import { useCallback } from 'react';
|
|
3
3
|
import { AuthAPI } from '@quiltt/core';
|
|
4
|
-
import { u as useImportSession, a as useIdentifySession, b as useAuthenticateSession, c as useRevokeSession } from './QuilttAuthProvider-12s-
|
|
4
|
+
import { u as useImportSession, a as useIdentifySession, b as useAuthenticateSession, c as useRevokeSession } from './QuilttAuthProvider-12s-4hQ7iysR.js';
|
|
5
5
|
import { u as useQuilttSettings } from './useQuilttSettings-12s--rCJoNHD.js';
|
|
6
6
|
import { u as useSession } from './useSession-12s-7GOn4sUn.js';
|
|
7
7
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@quiltt/react",
|
|
3
|
-
"version": "4.3.
|
|
3
|
+
"version": "4.3.3",
|
|
4
4
|
"description": "React Components and Hooks for Quiltt Connector",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"quiltt",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"dependencies": {
|
|
37
37
|
"@apollo/client": "^3.14.0",
|
|
38
38
|
"use-debounce": "^10.0.4",
|
|
39
|
-
"@quiltt/core": "4.3.
|
|
39
|
+
"@quiltt/core": "4.3.3"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@biomejs/biome": "2.2.4",
|
|
@@ -14,6 +14,7 @@ type IdentifySessionCallbacks = {
|
|
|
14
14
|
onSuccess?: () => unknown
|
|
15
15
|
onChallenged?: () => unknown
|
|
16
16
|
onError?: (errors: UnprocessableData) => unknown
|
|
17
|
+
onForbidden?: () => unknown
|
|
17
18
|
}
|
|
18
19
|
export type IdentifySession = (
|
|
19
20
|
payload: UsernamePayload,
|
|
@@ -37,6 +38,10 @@ export const useIdentifySession: UseIdentifySession = (auth, setSession) => {
|
|
|
37
38
|
if (callbacks.onChallenged) return callbacks.onChallenged()
|
|
38
39
|
break
|
|
39
40
|
|
|
41
|
+
case 403: // Forbidden (signups disabled)
|
|
42
|
+
if (callbacks.onForbidden) return callbacks.onForbidden()
|
|
43
|
+
break
|
|
44
|
+
|
|
40
45
|
case 422: // Unprocessable Content
|
|
41
46
|
if (callbacks.onError) return callbacks.onError((response as UnprocessableResponse).data)
|
|
42
47
|
break
|