@asgardeo/react 0.2.0 → 0.2.1
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/cjs/index.js +149 -36
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/components/SignIn/fragments/BasicAuth.d.ts +2 -2
- package/dist/cjs/types/components/SignIn/fragments/EmailOtp.d.ts +2 -2
- package/dist/cjs/types/components/SignIn/fragments/IdentifierFirst.d.ts +2 -2
- package/dist/cjs/types/components/SignIn/fragments/SmsOtp.d.ts +2 -2
- package/dist/cjs/types/components/SignIn/fragments/Totp.d.ts +2 -2
- package/dist/cjs/types/models/auth-context.d.ts +2 -0
- package/dist/cjs/types/models/sign-in.d.ts +5 -0
- package/dist/cjs/types/models/use-authentication.d.ts +2 -0
- package/dist/esm/index.js +149 -36
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/components/SignIn/fragments/BasicAuth.d.ts +2 -2
- package/dist/esm/types/components/SignIn/fragments/EmailOtp.d.ts +2 -2
- package/dist/esm/types/components/SignIn/fragments/IdentifierFirst.d.ts +2 -2
- package/dist/esm/types/components/SignIn/fragments/SmsOtp.d.ts +2 -2
- package/dist/esm/types/components/SignIn/fragments/Totp.d.ts +2 -2
- package/dist/esm/types/models/auth-context.d.ts +2 -0
- package/dist/esm/types/models/sign-in.d.ts +5 -0
- package/dist/esm/types/models/use-authentication.d.ts +2 -0
- package/dist/index.d.ts +7 -0
- package/package.json +1 -1
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { ReactElement } from 'react';
|
|
18
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
19
19
|
import BasicAuthProps from '../../../models/basic-auth-props';
|
|
20
20
|
import './basic-auth.scss';
|
|
21
21
|
/**
|
|
@@ -31,5 +31,5 @@ import './basic-auth.scss';
|
|
|
31
31
|
*
|
|
32
32
|
* @return {ReactElement}
|
|
33
33
|
*/
|
|
34
|
-
declare const BasicAuth: ({ handleAuthenticate, authenticator, alert, brandingProps, showSelfSignUp, renderLoginOptions, }: BasicAuthProps) => ReactElement;
|
|
34
|
+
declare const BasicAuth: ({ handleAuthenticate, authenticator, children, alert, brandingProps, showSelfSignUp, renderLoginOptions, }: PropsWithChildren<BasicAuthProps>) => ReactElement;
|
|
35
35
|
export default BasicAuth;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { ReactElement } from 'react';
|
|
18
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
19
19
|
import EmailOtpProps from '../../../models/email-otp-props';
|
|
20
20
|
import './email-otp.scss';
|
|
21
21
|
/**
|
|
@@ -28,5 +28,5 @@ import './email-otp.scss';
|
|
|
28
28
|
* @param {AlertType} props.alert - Alert type.
|
|
29
29
|
* @return {ReactElement}
|
|
30
30
|
*/
|
|
31
|
-
declare const EmailOtp: ({ alert, brandingProps, authenticator, handleAuthenticate }: EmailOtpProps) => ReactElement;
|
|
31
|
+
declare const EmailOtp: ({ alert, brandingProps, authenticator, children, handleAuthenticate }: PropsWithChildren<EmailOtpProps>) => ReactElement;
|
|
32
32
|
export default EmailOtp;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { ReactElement } from 'react';
|
|
18
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
19
19
|
import BasicAuthProps from '../../../models/basic-auth-props';
|
|
20
20
|
import './basic-auth.scss';
|
|
21
21
|
/**
|
|
@@ -31,5 +31,5 @@ import './basic-auth.scss';
|
|
|
31
31
|
*
|
|
32
32
|
* @return {ReactElement}
|
|
33
33
|
*/
|
|
34
|
-
declare const IdentifierFirst: ({ handleAuthenticate, authenticator, alert, brandingProps, showSelfSignUp, renderLoginOptions, }: BasicAuthProps) => ReactElement;
|
|
34
|
+
declare const IdentifierFirst: ({ handleAuthenticate, authenticator, alert, brandingProps, children, showSelfSignUp, renderLoginOptions, }: PropsWithChildren<BasicAuthProps>) => ReactElement;
|
|
35
35
|
export default IdentifierFirst;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { ReactElement } from 'react';
|
|
18
|
+
import { PropsWithChildren, ReactElement } from 'react';
|
|
19
19
|
import EmailOtpProps from '../../../models/email-otp-props';
|
|
20
|
-
declare const SmsOtp: ({ alert, brandingProps, authenticator, handleAuthenticate }: EmailOtpProps) => ReactElement;
|
|
20
|
+
declare const SmsOtp: ({ alert, brandingProps, authenticator, children, handleAuthenticate, }: PropsWithChildren<EmailOtpProps>) => ReactElement;
|
|
21
21
|
export default SmsOtp;
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* specific language governing permissions and limitations
|
|
16
16
|
* under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { ReactElement } from 'react';
|
|
18
|
+
import { ReactElement, PropsWithChildren } from 'react';
|
|
19
19
|
import TotpProps from '../../../models/totp-props';
|
|
20
20
|
import './totp.scss';
|
|
21
21
|
/**
|
|
@@ -29,5 +29,5 @@ import './totp.scss';
|
|
|
29
29
|
*
|
|
30
30
|
* @return {ReactElement}
|
|
31
31
|
*/
|
|
32
|
-
declare const Totp: ({ brandingProps, authenticator, handleAuthenticate, alert }: TotpProps) => ReactElement;
|
|
32
|
+
declare const Totp: ({ brandingProps, authenticator, children, handleAuthenticate, alert, }: PropsWithChildren<TotpProps>) => ReactElement;
|
|
33
33
|
export default Totp;
|
|
@@ -34,6 +34,8 @@ interface AuthContext {
|
|
|
34
34
|
setIsTextLoading: (value: boolean) => void;
|
|
35
35
|
setOnSignIn: (response?: any) => void | Promise<void>;
|
|
36
36
|
setOnSignOut: (response?: any) => void | Promise<void>;
|
|
37
|
+
setUsername: (username: string) => void;
|
|
37
38
|
user: MeAPIResponse;
|
|
39
|
+
username: string;
|
|
38
40
|
}
|
|
39
41
|
export default AuthContext;
|
|
@@ -18,10 +18,15 @@
|
|
|
18
18
|
import { BrandingProps } from '@asgardeo/js';
|
|
19
19
|
import { ReactElement } from 'react';
|
|
20
20
|
export interface SignInProps {
|
|
21
|
+
basicAuthChildren?: ReactElement;
|
|
21
22
|
brandingProps?: BrandingProps;
|
|
23
|
+
emailOtpChildren?: ReactElement;
|
|
24
|
+
identifierFirstChildren?: ReactElement;
|
|
22
25
|
showFooter?: boolean;
|
|
23
26
|
showLogo?: boolean;
|
|
24
27
|
showSignUp?: boolean;
|
|
28
|
+
smsOtpChildren?: ReactElement;
|
|
29
|
+
totpChildren?: ReactElement;
|
|
25
30
|
}
|
|
26
31
|
export type AlertType = {
|
|
27
32
|
alertType: {
|
|
@@ -20,7 +20,9 @@ interface UseAuthentication {
|
|
|
20
20
|
accessToken: string;
|
|
21
21
|
authResponse: AuthApiResponse;
|
|
22
22
|
isAuthenticated: Promise<boolean> | boolean;
|
|
23
|
+
setUsername: (username: string) => void;
|
|
23
24
|
signOut: () => void;
|
|
24
25
|
user: MeAPIResponse;
|
|
26
|
+
username: string;
|
|
25
27
|
}
|
|
26
28
|
export default UseAuthentication;
|
package/dist/index.d.ts
CHANGED
|
@@ -21,10 +21,15 @@ export { UIAuthConfig } from '@asgardeo/js';
|
|
|
21
21
|
*/
|
|
22
22
|
|
|
23
23
|
interface SignInProps {
|
|
24
|
+
basicAuthChildren?: ReactElement;
|
|
24
25
|
brandingProps?: BrandingProps;
|
|
26
|
+
emailOtpChildren?: ReactElement;
|
|
27
|
+
identifierFirstChildren?: ReactElement;
|
|
25
28
|
showFooter?: boolean;
|
|
26
29
|
showLogo?: boolean;
|
|
27
30
|
showSignUp?: boolean;
|
|
31
|
+
smsOtpChildren?: ReactElement;
|
|
32
|
+
totpChildren?: ReactElement;
|
|
28
33
|
}
|
|
29
34
|
interface SignInButtonProps extends SignInProps {
|
|
30
35
|
customComponent?: ReactElement;
|
|
@@ -302,8 +307,10 @@ interface UseAuthentication {
|
|
|
302
307
|
accessToken: string;
|
|
303
308
|
authResponse: AuthApiResponse;
|
|
304
309
|
isAuthenticated: Promise<boolean> | boolean;
|
|
310
|
+
setUsername: (username: string) => void;
|
|
305
311
|
signOut: () => void;
|
|
306
312
|
user: MeAPIResponse;
|
|
313
|
+
username: string;
|
|
307
314
|
}
|
|
308
315
|
|
|
309
316
|
/**
|