@contember/react-client-tenant 2.1.0-alpha.2 → 2.1.0-alpha.21
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/dist/development/src/components/forms/LoginForm.cjs +2 -0
- package/dist/development/src/components/forms/LoginForm.cjs.map +1 -1
- package/dist/development/src/components/forms/LoginForm.js +2 -0
- package/dist/development/src/components/forms/LoginForm.js.map +1 -1
- package/dist/development/src/components/idp/IDP.cjs +4 -4
- package/dist/development/src/components/idp/IDP.cjs.map +1 -1
- package/dist/development/src/components/idp/IDP.js +4 -4
- package/dist/development/src/components/idp/IDP.js.map +1 -1
- package/dist/production/src/components/forms/LoginForm.cjs +2 -0
- package/dist/production/src/components/forms/LoginForm.cjs.map +1 -1
- package/dist/production/src/components/forms/LoginForm.js +2 -0
- package/dist/production/src/components/forms/LoginForm.js.map +1 -1
- package/dist/production/src/components/idp/IDP.cjs +2 -2
- package/dist/production/src/components/idp/IDP.cjs.map +1 -1
- package/dist/production/src/components/idp/IDP.js +2 -2
- package/dist/production/src/components/idp/IDP.js.map +1 -1
- package/dist/types/components/idp/IDP.d.ts +2 -1
- package/dist/types/components/idp/IDP.d.ts.map +1 -1
- package/dist/types/hooks/mutations/auth/useChangeMyPasswordMutation.d.ts +2 -0
- package/dist/types/hooks/mutations/auth/useChangeMyPasswordMutation.d.ts.map +1 -1
- package/dist/types/hooks/mutations/auth/useSignInMutation.d.ts +2 -0
- package/dist/types/hooks/mutations/auth/useSignInMutation.d.ts.map +1 -1
- package/dist/types/hooks/mutations/passwordReset/useResetPasswordMutation.d.ts +2 -0
- package/dist/types/hooks/mutations/passwordReset/useResetPasswordMutation.d.ts.map +1 -1
- package/dist/types/tsconfig.tsbuildinfo +1 -1
- package/package.json +4 -4
- package/src/components/forms/LoginForm.tsx +2 -0
- package/src/components/idp/IDP.tsx +3 -2
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@contember/react-client-tenant",
|
|
3
3
|
"license": "Apache-2.0",
|
|
4
|
-
"version": "2.1.0-alpha.
|
|
4
|
+
"version": "2.1.0-alpha.21",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"sideEffects": false,
|
|
7
7
|
"main": "./dist/production/index.js",
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"directory": "packages/react-client-tenant"
|
|
35
35
|
},
|
|
36
36
|
"dependencies": {
|
|
37
|
-
"@contember/graphql-client-tenant": "2.1.0-alpha.
|
|
38
|
-
"@contember/react-client": "2.1.0-alpha.
|
|
39
|
-
"@contember/react-utils": "2.1.0-alpha.
|
|
37
|
+
"@contember/graphql-client-tenant": "2.1.0-alpha.21",
|
|
38
|
+
"@contember/react-client": "2.1.0-alpha.21",
|
|
39
|
+
"@contember/react-utils": "2.1.0-alpha.21",
|
|
40
40
|
"@radix-ui/primitive": "^1.1.0",
|
|
41
41
|
"@radix-ui/react-slot": "^1.1.0",
|
|
42
42
|
"graphql-ts-client-api": "^3.1.17"
|
|
@@ -106,5 +106,7 @@ const errorToField: Record<TenantApi.SignInErrorCode, keyof LoginFormValues | un
|
|
|
106
106
|
'UNKNOWN_EMAIL': 'email',
|
|
107
107
|
'PERSON_DISABLED': 'email',
|
|
108
108
|
'INVALID_OTP_TOKEN': 'otpToken',
|
|
109
|
+
'INVALID_CREDENTIALS': 'password',
|
|
110
|
+
'RATE_LIMIT_EXCEEDED': 'password',
|
|
109
111
|
'OTP_REQUIRED': undefined,
|
|
110
112
|
}
|
|
@@ -10,9 +10,10 @@ export interface IDPProps {
|
|
|
10
10
|
onLogin?: () => void
|
|
11
11
|
onInitError?: (error: IDPInitError) => void
|
|
12
12
|
onResponseError?: (error: IDPResponseError) => void
|
|
13
|
+
expiration?: number
|
|
13
14
|
}
|
|
14
15
|
|
|
15
|
-
export const IDP = ({ children, onResponseError, onInitError, onLogin }: IDPProps) => {
|
|
16
|
+
export const IDP = ({ children, onResponseError, onInitError, onLogin, expiration }: IDPProps) => {
|
|
16
17
|
const hasOauthResponse = useMemo(() => {
|
|
17
18
|
const params = new URLSearchParams(window.location.search)
|
|
18
19
|
return params.has('state') && (params.has('code') || params.has('id_token'))
|
|
@@ -28,7 +29,7 @@ export const IDP = ({ children, onResponseError, onInitError, onLogin }: IDPProp
|
|
|
28
29
|
}
|
|
29
30
|
return { type: 'nothing' }
|
|
30
31
|
})
|
|
31
|
-
useHandleIDPResponse({ hasOauthResponse, setState, onLogin })
|
|
32
|
+
useHandleIDPResponse({ hasOauthResponse, setState, onLogin, expiration: expiration })
|
|
32
33
|
|
|
33
34
|
const initRedirect = useInitIDPRedirect({ setState })
|
|
34
35
|
|