@asgardeo/react 0.1.1 → 0.2.0

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.
@@ -0,0 +1,35 @@
1
+ /**
2
+ * Copyright (c) 2024, WSO2 LLC. (https://www.wso2.com).
3
+ *
4
+ * WSO2 LLC. licenses this file to you under the Apache License,
5
+ * Version 2.0 (the "License"); you may not use this file except
6
+ * in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing,
12
+ * software distributed under the License is distributed on an
13
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14
+ * KIND, either express or implied. See the License for the
15
+ * specific language governing permissions and limitations
16
+ * under the License.
17
+ */
18
+ import { ReactElement } from 'react';
19
+ import BasicAuthProps from '../../../models/basic-auth-props';
20
+ import './basic-auth.scss';
21
+ /**
22
+ * This component renders the IdentifierFirst authentication form.
23
+ *
24
+ * @param {IdentifierFirstProps} props - Props injected to the IdentifierFirst authentication component.
25
+ * @param {BrandingProps} props.brandingProps - Branding props.
26
+ * @param {Function} props.handleAuthenticate - Callback to handle authentication.
27
+ * @param {Authenticator} props.authenticator - Authenticator.
28
+ * @param {AlertType} props.alert - Alert type.
29
+ * @param {ReactElement[]} props.renderLoginOptions - Login options.
30
+ * @param {boolean} props.showSelfSignUp - Show self sign up.
31
+ *
32
+ * @return {ReactElement}
33
+ */
34
+ declare const IdentifierFirst: ({ handleAuthenticate, authenticator, alert, brandingProps, showSelfSignUp, renderLoginOptions, }: BasicAuthProps) => ReactElement;
35
+ export default IdentifierFirst;
@@ -16,9 +16,10 @@
16
16
  * under the License.
17
17
  */
18
18
  /// <reference types="react" />
19
- import { UIAuthConfig, MeAPIResponse } from '@asgardeo/js';
19
+ import { UIAuthConfig, MeAPIResponse, AuthApiResponse } from '@asgardeo/js';
20
20
  interface AuthContext {
21
21
  accessToken: string;
22
+ authResponse: AuthApiResponse;
22
23
  config: UIAuthConfig;
23
24
  isAuthLoading: boolean;
24
25
  isAuthenticated: boolean | undefined;
@@ -26,6 +27,7 @@ interface AuthContext {
26
27
  isGlobalLoading: boolean;
27
28
  isTextLoading: boolean;
28
29
  onSignOutRef: React.MutableRefObject<Function>;
30
+ setAuthResponse: (response: AuthApiResponse) => void;
29
31
  setAuthentication: () => void;
30
32
  setIsAuthLoading: (value: boolean) => void;
31
33
  setIsBrandingLoading: (value: boolean) => void;
@@ -15,9 +15,10 @@
15
15
  * specific language governing permissions and limitations
16
16
  * under the License.
17
17
  */
18
- import { MeAPIResponse } from '@asgardeo/js';
18
+ import { AuthApiResponse, MeAPIResponse } from '@asgardeo/js';
19
19
  interface UseAuthentication {
20
20
  accessToken: string;
21
+ authResponse: AuthApiResponse;
21
22
  isAuthenticated: Promise<boolean> | boolean;
22
23
  signOut: () => void;
23
24
  user: MeAPIResponse;
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import { ReactElement, FC, PropsWithChildren } from 'react';
2
- import { BrandingProps, UIAuthConfig, Store, MeAPIResponse } from '@asgardeo/js';
2
+ import { BrandingProps, UIAuthConfig, Store, AuthApiResponse, MeAPIResponse } from '@asgardeo/js';
3
3
  export { UIAuthConfig } from '@asgardeo/js';
4
4
 
5
5
  /**
@@ -300,6 +300,7 @@ declare const AsgardeoProvider: FC<PropsWithChildren<AsgardeoProviderProps>>;
300
300
 
301
301
  interface UseAuthentication {
302
302
  accessToken: string;
303
+ authResponse: AuthApiResponse;
303
304
  isAuthenticated: Promise<boolean> | boolean;
304
305
  signOut: () => void;
305
306
  user: MeAPIResponse;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@asgardeo/react",
3
- "version": "0.1.1",
3
+ "version": "0.2.0",
4
4
  "description": "React Wrapper to build customizable login UIs for Asgardeo or Identity Server",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",