Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
131 commits
Select commit Hold shift + click to select a range
7a490af
chore(recipes): update react sample
brionmario Jun 6, 2025
addc211
fix: set fallback to null in BaseUserDropdown and BaseUserProfile com…
brionmario Jun 6, 2025
37b5b64
chore(javascript): reorganize OIDC-related imports and add new OIDC d…
brionmario Jun 6, 2025
92c684e
chore: replace ResponseMode enum with string literals and introduce O…
brionmario Jun 6, 2025
9157848
chore(javascript): reorganize OIDC-related imports and migrate to new…
brionmario Jun 6, 2025
999a3a4
chore(javascript): reorganize OIDC-related imports and migrate to new…
brionmario Jun 6, 2025
9d9dd7c
chore: replace GetAuthURLConfig with ExtendedAuthorizeRequestUrlParam…
brionmario Jun 7, 2025
0f18fb8
chore(javascript): refactor authorization URL parameter handling and …
brionmario Jun 8, 2025
353bacb
chore(javascript): add unit tests for getAuthorizeRequestUrlParams fu…
brionmario Jun 8, 2025
33944ea
chore(recipes): add sign-in button to header component for user authe…
brionmario Jun 8, 2025
e9c19db
chore(javascript): refactor storage handling to use BrowserStorage en…
brionmario Jun 8, 2025
42f50e9
chore(react): enforce required signIn and signOut props in button int…
brionmario Jun 9, 2025
f0e6f09
chore(recipes): fix lint issues
brionmario Jun 9, 2025
c56bb3c
chore(javascript): rename `DataLayer` to `StorageManager`
brionmario Jun 9, 2025
b540f6a
chore(recipes): update default route to redirect to dashboard page
brionmario Jun 9, 2025
30fde43
chore: refactor code to replace `getDataLayer` with `getStorageManage…
brionmario Jun 9, 2025
265de1f
chore: refactor imports to use new SessionData model and remove legac…
brionmario Jun 9, 2025
eaebb07
chore(javascript): remove legacy authentication core and index files
brionmario Jun 9, 2025
bf52459
chore: remove unused import of Navigate from react-router-dom
brionmario Jun 9, 2025
efabcb7
chore(javascript): refactor exception handling by moving AsgardeoAuth…
brionmario Jun 9, 2025
56c0ed8
chore(javascript): add authorize function and related interfaces for …
brionmario Jun 9, 2025
bbba841
chore(javascript): implement Asgardeo client interface with new metho…
brionmario Jun 9, 2025
0e2d7dd
chore: standardize `clientID` to `clientId` across documentation and …
brionmario Jun 9, 2025
9b6d458
chore: rename `signInRedirectURL` to `afterSignInUrl` across codebase…
brionmario Jun 9, 2025
8f9f3b8
chore(express): init express package
brionmario Jun 9, 2025
88af881
Revert "chore(javascript): implement Asgardeo client interface with n…
brionmario Jun 9, 2025
e79fc3a
chore(express): update Asgardeo client to use LegacyAsgardeoNodeClien…
brionmario Jun 9, 2025
cf2b1e2
chore: rename `signOutRedirectURL` to `afterSignOutUrl` for consisten…
brionmario Jun 9, 2025
80ae2e7
chore: standardize variable name from `userID` to `userId` across mul…
brionmario Jun 9, 2025
aaa873e
chore: standardize method name from `getInstanceID` to `getInstanceId…
brionmario Jun 10, 2025
e975f69
chore: rename `getAuthorizationURL` to `getSignInUrl` for consistency…
brionmario Jun 10, 2025
ec728e1
chore: standardize method name from `getSignOutURL` to `getSignOutUrl…
brionmario Jun 10, 2025
0b74eca
chore: rename method `getOIDCProviderMetaData` to `loadOpenIDProvider…
brionmario Jun 10, 2025
35f2346
chore: rename `getOIDCServiceEndpoints` to `getOpenIDProviderEndpoint…
brionmario Jun 10, 2025
2c79228
chore: remove unused methods `getCreatedAt` and `getExpiresIn` for co…
brionmario Jun 10, 2025
bf85f7e
chore: rename method `getCryptoHelper` to `getCrypto` for consistency…
brionmario Jun 10, 2025
2e9b11f
chore: rename method `requestCustomGrant` to `exchangeToken` for cons…
brionmario Jun 10, 2025
0a137c6
chore: rename authentication methods from `isAuthenticated` to `isSig…
brionmario Jun 10, 2025
fd8ae50
chore: update Header component to show user profile on click and adju…
brionmario Jun 10, 2025
f7377b2
chore: rename `getBasicUserInfo` to `getUser` for consistency across …
brionmario Jun 10, 2025
9f1ba9d
chore: rename `updateConfig` methods to `reInitialize` for consistenc…
brionmario Jun 10, 2025
621b1bd
chore: change profile link to a span for improved accessibility
brionmario Jun 10, 2025
f5fcc3b
chore: rename `clearUserSessionData` methods to `clearSession` for co…
brionmario Jun 10, 2025
a0271e7
chore: rename `getIDToken` methods to `getIdToken` for consistency ac…
brionmario Jun 10, 2025
a3c6a80
chore: rename `getDecodedIDToken` methods to `getDecodedIdToken` for …
brionmario Jun 10, 2025
8552b32
chore: rename `decodeIDToken` methods to `decodeIdToken` for consiste…
brionmario Jun 10, 2025
c173e7c
feat: implement application native authentication functions and models
brionmario Jun 10, 2025
0d1db6c
feat: implement native authentication components and update related m…
brionmario Jun 11, 2025
1e90cff
chore(react): add field factory utilities and integrate into BaseSign…
brionmario Jun 11, 2025
458c1aa
feat: implement reusable Button component and update related componen…
brionmario Jun 11, 2025
7ad0c98
refactor: update Button import statements and adjust props for consis…
brionmario Jun 11, 2025
1ee2178
chore(react): add password toggle functionality to TextField and impl…
brionmario Jun 11, 2025
9bb8c1b
chore(react): implement Card component and integrate it into BaseSign…
brionmario Jun 11, 2025
b67df3a
feat(react): add new icon components (CircleAlert, CircleCheck, Trian…
brionmario Jun 11, 2025
63a6581
feat(react): add Alert component with variants and styles, and update…
brionmario Jun 11, 2025
1e329ff
feat(react): update theme colors to use background.surface and integr…
brionmario Jun 11, 2025
fa180a9
feat(react): refactor SignIn component to use withVendorCSSClassPrefi…
brionmario Jun 11, 2025
92dced7
feat(react): add OtpInput component and integrate field type resoluti…
brionmario Jun 11, 2025
2f4dde3
feat(react): introduce FormControl and InputLabel components; refacto…
brionmario Jun 11, 2025
b8fcad7
chore(react): replace OtpInput with OtpField component; update FieldF…
brionmario Jun 11, 2025
feb7d4f
feat(react): add internationalization support with I18n models and ho…
brionmario Jun 11, 2025
e328cf6
feat(react): implement internationalization support; add I18nProvider…
brionmario Jun 11, 2025
dc09fdb
chore(react): Move hooks and contexts to dedicated directories
brionmario Jun 11, 2025
881e2fe
chore(react): minor fixes
brionmario Jun 12, 2025
ed233ee
feat(react): enhance BaseSignIn and SignIn components for multi-authe…
brionmario Jun 12, 2025
ce7e055
chore(react): fix idf flow
brionmario Jun 12, 2025
9672d8b
feat(react): Add various sign-in options and authentication components
brionmario Jun 12, 2025
e983b39
refactor(react): Update sign-in option imports and remove unused type…
brionmario Jun 12, 2025
4cce5ae
chore(react): Replace hardcoded class names with vendor-prefixed clas…
brionmario Jun 12, 2025
89d2233
chore(react): Refactor SignIn component to delegate UI logic to BaseS…
brionmario Jun 12, 2025
4a20e95
chore(react): fix otp placeholders
brionmario Jun 12, 2025
11a7396
feat(react): Add start icons to social sign-in buttons for improved UX
brionmario Jun 12, 2025
65b4936
feat: Enhance Sign-In Options with Localization and Multi-Option Support
brionmario Jun 12, 2025
d2c5f84
fix(react): fix divider style
brionmario Jun 13, 2025
603d6ba
feat(react): Add PasswordField component and update SignIn page with …
brionmario Jun 13, 2025
bf44af8
feat(react): Implement useForm hook for enhanced form state managemen…
brionmario Jun 13, 2025
1842659
chore: fix formatting and i18n
brionmario Jun 13, 2025
48ba3de
feat(react): Implement Flow context for managing authentication flow …
brionmario Jun 13, 2025
f9d8898
feat(react): Add Typography component for consistent text rendering a…
brionmario Jun 13, 2025
bcd2d56
feat(react): Enhance form fields with placeholder support and integra…
brionmario Jun 13, 2025
17230d9
fix(react): Correct gap calculation in useButtonStyles for consistent…
brionmario Jun 13, 2025
43740d3
chore(react): Update useFlow import paths and remove unused Flow inde…
brionmario Jun 13, 2025
8df3cbd
chore(react): Replace useFlowOptional with useFlow for improved flow …
brionmario Jun 13, 2025
327aad4
chore(react): Remove useSignInForm hook to streamline authentication …
brionmario Jun 13, 2025
6172843
fix(react): Enhance authentication flow to handle authenticators with…
brionmario Jun 13, 2025
1dc2f96
fix(react): Refactor authentication handling in BaseSignIn component …
brionmario Jun 13, 2025
1c3d1c1
fix(react): Update prompt type enums and implement redirection handli…
brionmario Jun 14, 2025
374a435
chore: replace BasicUserInfo with User across the codebase
brionmario Jun 15, 2025
1f38ac4
chore: rename CustomGrantConfig to TokenExchangeRequestConfig across …
brionmario Jun 15, 2025
bbc3767
chore: refactor scope handling to use processOpenIDScopes utility for…
brionmario Jun 15, 2025
01926da
chore: replace FetchResponse with Response across the codebase
brionmario Jun 15, 2025
03c49fb
chore(react): enhance user profile handling with flattening and dynam…
brionmario Jun 15, 2025
c0bed93
chore: update user profile generation functions to improve clarity an…
brionmario Jun 15, 2025
66d68b6
feat(react): add UserContext, UserProvider, and useUser hook for user…
brionmario Jun 15, 2025
090201b
feat(react): integrate UserProvider within AsgardeoProvider for enhan…
brionmario Jun 15, 2025
fa31862
chore(javascript): update user schema handling by exporting UserProfi…
brionmario Jun 15, 2025
d72364b
chore: Refactor user profile handling and dropdown components
brionmario Jun 15, 2025
832f679
chore: replace Popover component with Dialog for user profile display
brionmario Jun 15, 2025
4a2b822
chore(react): update import statements to use default imports for use…
brionmario Jun 15, 2025
d31d713
feat(recipes): add header components for authenticated and public act…
brionmario Jun 16, 2025
94923e5
feat(recipes): implement layout components for landing, authenticated…
brionmario Jun 16, 2025
81192cb
chore(recipes): update formatting
brionmario Jun 16, 2025
b13f110
feat(react): implement native authentication flow and add afterSignIn…
brionmario Jun 16, 2025
ba7bb57
feat(react): enhance passkey authentication flow and update button icons
brionmario Jun 16, 2025
dffb7bc
chore(react): add vite-plugin-mkcert for HTTPS support and update vit…
brionmario Jun 16, 2025
f44b88e
chore(react): simplify SignIn component by removing unused props and …
brionmario Jun 16, 2025
72eabda
chore: temp comment out worker ref
brionmario Jun 16, 2025
1087238
feat(react): implement Asgardeo authentication context and provider
brionmario Jun 16, 2025
851139a
feat(react): integrate AsgardeoProvider in layout and enhance middlew…
brionmario Jun 16, 2025
d669acf
feat(react): add BaseUser and User components for user management
brionmario Jun 16, 2025
199bd44
feat(next): add SignInButton, SignOutButton, SignUpButton components …
brionmario Jun 16, 2025
635db03
chore(recipes): update recipe name
brionmario Jun 16, 2025
d57b68c
chore(samples): refactor
brionmario Jun 16, 2025
0790bca
Refactor: Remove AsgardeoProvider from layout and update organization…
brionmario Jun 16, 2025
796259f
chore: refactor samples
brionmario Jun 16, 2025
8a3d1c1
chore(next): update components
brionmario Jun 16, 2025
e7f3c1c
chore(samples): update samples
brionmario Jun 16, 2025
ef1775a
fix(javascript): handle potential undefined idToken in decodeIdToken …
brionmario Jun 16, 2025
a773125
feat: enhance user context and update user display in the Home component
brionmario Jun 16, 2025
2c1fb5a
fix(react): make profile and schemas optional in BaseUserProfileProps…
brionmario Jun 17, 2025
e4932a3
chore(samples): remove unused components and files, implement Asgarde…
brionmario Jun 17, 2025
4c32a23
fix(react): fix build
brionmario Jun 17, 2025
775f953
chore(react): code structure for improved readability and maintainabi…
brionmario Jun 17, 2025
1c4c7a6
docs: update README
brionmario Jun 17, 2025
8345202
docs: update API documentation for User component render props and ex…
brionmario Jun 17, 2025
8bff9ae
docs: enhance API documentation with new components and examples for …
brionmario Jun 17, 2025
3754d9b
fix: update package.json files to correct homepage and repository URLs
brionmario Jun 17, 2025
2a0c6b9
chore: exclude nuxt package from pnpm workspace
brionmario Jun 17, 2025
5a9afbd
fix: update package versions to 0.0.1 for browser, javascript, nextjs…
brionmario Jun 17, 2025
efe951f
chore: add changeset 🦋
brionmario Jun 17, 2025
cdcc723
refactor: remove obsolete greet test files from nextjs, node, and rea…
brionmario Jun 17, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
7 changes: 7 additions & 0 deletions .changeset/smart-spiders-film.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
'@asgardeo/browser': minor
'@asgardeo/javascript': minor
'@asgardeo/react': minor
---

Support `SignIn` component in `@asgardeo/react`.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ This repository contains the source code of JavaScript SDKs that can be used to
| [![@asgardeo/browser](https://img.shields.io/npm/v/@asgardeo/browser?color=%234B32C3&label=%40asgardeo%2Fbrowser&logo=firefox)](./packages/browser/) | Browser-based JavaScript SDK |
| [![@asgardeo/nextjs](https://img.shields.io/npm/v/@asgardeo/nextjs?color=%23000000&label=%40asgardeo%2Fnext&logo=next.js)](./packages/next/) | Next.js SDK for building applications with Asgardeo |
| [![@asgardeo/node](https://img.shields.io/npm/v/@asgardeo/node?color=%23339933&label=%40asgardeo%2Fnode&logo=node.js)](./packages/node/) | Node.js SDK for server-side integration |
| [![@asgardeo/express](https://img.shields.io/npm/v/@asgardeo/express?color=%23339933&label=%40asgardeo%2Fexpress&logo=express)](./packages/express/) | Express.js SDK for server-side integration |
| [![@asgardeo/nuxt](https://img.shields.io/npm/v/@asgardeo/nuxt?color=%2300DC82&label=%40asgardeo%2Fnuxt&logo=nuxt)](./packages/nuxt/) | Nuxt.js SDK for building applications with Asgardeo |
| [![@asgardeo/react](https://img.shields.io/npm/v/@asgardeo/react?color=%2361DAFB&label=%40asgardeo%2Freact&logo=react)](./packages/react/) | React SDK for building applications with Asgardeo |
| [![@asgardeo/vue](https://img.shields.io/npm/v/@asgardeo/vue?color=%234FC08D&label=%40asgardeo%2Fvue&logo=vue.js)](./packages/vue/) | Vue.js SDK for building applications with Asgardeo |
Expand Down
4 changes: 2 additions & 2 deletions docs/src/react/components/asgardeo-provider.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ import { AsgardeoProvider } from "@asgardeo/react";

- `baseURL`: The base URL of asgardeo.

- `signInRedirectURL`: The URL where users should be redirected after they sign in. This should be a page in your application.
- `afterSignInUrl`: The URL where users should be redirected after they sign in. This should be a page in your application.

- `clientID`: The ID of your application. You get this when you register your application with Asgardeo.
- `clientId`: The ID of your application. You get this when you register your application with Asgardeo.

- `scope`: The scope of the access request. This is a list of scopes separated by spaces. Scopes allow your application to request access only to the resources it needs, and also allow users to control how much access they grant to your application.

Expand Down
8 changes: 4 additions & 4 deletions docs/src/react/hooks/use-authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ import { useAuthentication } from "@asgardeo/react";
Then, you can use it in your component:

```ts
const { user, isAuthenticated, accessToken, signOut } = useAuthentication();
const { user, isSignedIn, accessToken, signOut } = useAuthentication();
```

## Return Value
Expand All @@ -40,7 +40,7 @@ The `useAuthentication` hook returns an object with the following properties:

- `user`: The current user. This is an object that contains information about the user.

- `isAuthenticated`: A boolean that indicates whether the user is authenticated.
- `isSignedIn`: A boolean that indicates whether the user is authenticated.

- `accessToken`: The access token for the authenticated user.

Expand All @@ -49,9 +49,9 @@ The `useAuthentication` hook returns an object with the following properties:
Here's an example of how to use these values:

```ts
const { user, isAuthenticated, signOut } = useAuthentication();
const { user, isSignedIn, signOut } = useAuthentication();

if (isAuthenticated) {
if (isSignedIn) {
console.log(`User ${user.username} is authenticated.`);
} else {
console.log("User is not authenticated.");
Expand Down
4 changes: 2 additions & 2 deletions docs/src/react/introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,9 +71,9 @@ Then, wrap your application with the `AsgardeoProvider` and pass the basic confi
<AsgardeoProvider
config={{
baseUrl: "https://api.asgardeo.io/t/org_name",
clientID: "gqtroUbA1Qsulqr*****",
clientId: "gqtroUbA1Qsulqr*****",
scope: ["openid", "internal_login", "profile"],
signInRedirectURL: "https://domain_name:8080",
afterSignInUrl: "https://domain_name:8080",
}}>
<App />
</AsgardeoProvider>
Expand Down
9 changes: 5 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,13 @@
"description": "Workspace to hold the Asgardeo JavaScript SDKs.",
"author": "WSO2",
"license": "Apache-2.0",
"homepage": "https://github.com/asgardeo/javascript#readme",
"homepage": "https://github.com/asgardeo/web-ui-sdks#readme",
"bugs": {
"url": "https://github.com/asgardeo/javascript/issues"
"url": "https://github.com/asgardeo/web-ui-sdks/issues"
},
"repository": {
"type": "git",
"url": "https://github.com/asgardeo/javascript"
"url": "https://github.com/asgardeo/web-ui-sdks"
},
"keywords": [
"asgardeo",
Expand All @@ -24,6 +24,7 @@
"lint": "nx run-many --target=lint --all --parallel",
"publish:packages": "changeset publish",
"test": "nx run-many --target=test --all --parallel",
"typecheck": "nx run-many --target=typecheck --all --parallel",
"version:packages": "changeset version && pnpm install --lockfile-only"
},
"devDependencies": {
Expand All @@ -39,4 +40,4 @@
"publishConfig": {
"access": "restricted"
}
}
}
2 changes: 1 addition & 1 deletion packages/__legacy__/core/src/api/authenticate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ const authenticate = async (props: AuthenticateProps): Promise<AuthApiResponse>
};

/* Getting baseURL from authClient's data layer */
const {baseUrl} = await AuthClient.getInstance().getDataLayer().getConfigData();
const {baseUrl} = await AuthClient.getInstance().getStorageManager().getConfigData();

authnRequest = new Request(`${baseUrl}/oauth2/authn`, requestOptions);
} catch (error) {
Expand Down
8 changes: 5 additions & 3 deletions packages/__legacy__/core/src/api/authorize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,9 @@ const authorize = async (): Promise<AuthApiResponse> => {

try {
const authInstace: UIAuthClient = AuthClient.getInstance();
const params: Map<string, string> = await authInstace.getAuthorizationURLParams();
// FIXME: We should be able to get the URL itself.
// const params: Map<string, string> = await authInstace.getAuthorizationURLParams();
const params: Map<string, string> = new Map();

const formBody: URLSearchParams = new URLSearchParams();

Expand All @@ -41,7 +43,7 @@ const authorize = async (): Promise<AuthApiResponse> => {
});

/* Save the state temporarily in the data layer, this needs to be passed when token is requested */
await authInstace.getDataLayer().setTemporaryDataParameter('state', params.get('state'));
await authInstace.getStorageManager().setTemporaryDataParameter('state', params.get('state'));

const headers: Headers = new Headers();
headers.append('Accept', 'application/json');
Expand All @@ -53,7 +55,7 @@ const authorize = async (): Promise<AuthApiResponse> => {
method: 'POST',
};

authzURL = (await authInstace.getOIDCServiceEndpoints()).authorizationEndpoint;
authzURL = (await authInstace.getOpenIDProviderEndpoints()).authorizationEndpoint;
} catch (error) {
throw new AsgardeoUIException('JS_UI_CORE-AUTHZ-A-NF', 'Authorization request building failed', error.stack);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ const getBrandingPreferenceText = async (
params.append('screen', screen);
params.append('type', type);

const {baseUrl} = await AuthClient.getInstance().getDataLayer().getConfigData();
const {baseUrl} = await AuthClient.getInstance().getStorageManager().getConfigData();
const textUrl: string = `${baseUrl}/api/server/v1/branding-preference/text/resolve`;
const urlWithParams: string = `${textUrl}?${params.toString()}`;
let response: Response;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const getBrandingPreference = async (): Promise<BrandingPreferenceAPIResponse> =
baseUrl,
type = BrandingPreferenceTypes.Org,
name = 'WSO2',
} = await AuthClient.getInstance().getDataLayer().getConfigData();
} = await AuthClient.getInstance().getStorageManager().getConfigData();
const brandingUrl: string = `${baseUrl}/api/server/v1/branding-preference?type=${type}&name=${name}`;
let response: Response;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ const getProfileInformation = async (): Promise<MeAPIResponse> => {
let response: Response;

try {
baseUrl = (await AuthClient.getInstance().getDataLayer().getConfigData()).baseUrl;
baseUrl = (await AuthClient.getInstance().getStorageManager().getConfigData()).baseUrl;
accessToken = await AuthClient.getInstance().getAccessToken();
} catch (error) {
throw new AsgardeoUIException(
Expand Down
10 changes: 5 additions & 5 deletions packages/__legacy__/core/src/api/sign-out.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* under the License.
*/

import {AuthClient, ResponseMode} from '../auth-client';
import {AuthClient} from '../auth-client';
import AsgardeoUIException from '../exception';
import {UIAuthClient} from '../models/auth-config';

Expand Down Expand Up @@ -49,9 +49,9 @@ const signOut = async (): Promise<void> => {
const authClient: UIAuthClient = AuthClient.getInstance();

try {
formBody.append('id_token_hint', await authClient.getIDToken());
formBody.append('client_id', (await authClient.getDataLayer().getConfigData()).clientID);
formBody.append('response_mode', ResponseMode.Direct);
formBody.append('id_token_hint', await authClient.getIdToken());
formBody.append('client_id', (await authClient.getStorageManager().getConfigData()).clientId);
formBody.append('response_mode', 'direct');
} catch (error) {
throw new AsgardeoUIException('JS_UI_CORE-SIGNOUT-SO-IV', 'Failed to build the body of the signout request.');
}
Expand All @@ -63,7 +63,7 @@ const signOut = async (): Promise<void> => {
};

try {
const {endSessionEndpoint} = await authClient.getOIDCServiceEndpoints();
const {endSessionEndpoint} = await authClient.getOpenIDProviderEndpoints();
signOutUrl = endSessionEndpoint;
} catch (error) {
throw new AsgardeoUIException('JS_UI_CORE-SIGNOUT-SO-NF', 'Failed to retrieve the sign out endpoint.');
Expand Down
6 changes: 3 additions & 3 deletions packages/__legacy__/core/src/auth-client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
* under the License.
*/

import {AsgardeoAuthClient, Store, Crypto, ResponseMode} from '@asgardeo/auth-js';
import {AsgardeoAuthClient, Store, Crypto} from '@asgardeo/auth-js';
import {UIAuthClient, UIAuthConfig} from './models/auth-config';
import {BrandingPreferenceTypes} from './models/branding-api-response';

Expand Down Expand Up @@ -50,7 +50,7 @@ export class AuthClient {
enableConsoleBranding: authClientConfig?.enableConsoleBranding ?? true,
enableConsoleTextBranding: authClientConfig?.enableConsoleTextBranding ?? true,
name: authClientConfig?.name ?? DEFAULT_NAME,
responseMode: ResponseMode.Direct,
responseMode: 'direct',
type: authClientConfig?.type ?? BrandingPreferenceTypes.Org,
};

Expand All @@ -63,4 +63,4 @@ export class AuthClient {
}

/* Interfaces, classes and enums required from the auth-js package */
export {Crypto, JWKInterface, Store, AsgardeoAuthClient, TokenResponse, ResponseMode} from '@asgardeo/auth-js';
export {Crypto, JWKInterface, Store, AsgardeoAuthClient, TokenResponse} from '@asgardeo/auth-js';
2 changes: 1 addition & 1 deletion packages/__legacy__/core/src/branding/get-branding.ts
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ const getBranding = async (props: GetBrandingProps): Promise<Branding> => {
let brandingFromConsole: BrandingPreferenceAPIResponse;

try {
const {enableConsoleBranding} = await AuthClient.getInstance().getDataLayer().getConfigData();
const {enableConsoleBranding} = await AuthClient.getInstance().getStorageManager().getConfigData();

if (enableConsoleBranding) {
brandingFromConsole = await getBrandingPreference();
Expand Down
2 changes: 1 addition & 1 deletion packages/__legacy__/core/src/i18n/get-localization.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ const getLocalization = async (props: GetLocalizationProps): Promise<TextObject>

let textFromConsoleBranding: BrandingPreferenceTextAPIResponse;

const configData: AuthClientConfig<UIAuthConfig> = await AuthClient.getInstance().getDataLayer().getConfigData();
const configData: AuthClientConfig<UIAuthConfig> = await AuthClient.getInstance().getStorageManager().getConfigData();

try {
if (configData.enableConsoleTextBranding) {
Expand Down
10 changes: 5 additions & 5 deletions packages/__legacy__/react/src/components/SignIn/SignIn.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const SignIn: FC<SignInProps> = (props: SignInProps): ReactElement => {
const [showSelfSignUp, setShowSelfSignUp] = useState<boolean>(showSignUp);
const [componentBranding, setComponentBranding] = useState<Branding>();

const {isAuthenticated} = useAuthentication();
const {isSignedIn} = useAuthentication();
const {config} = useConfig();

const authContext: AuthContext | undefined = useContext(AsgardeoContext);
Expand Down Expand Up @@ -159,7 +159,7 @@ const SignIn: FC<SignInProps> = (props: SignInProps): ReactElement => {
/**
* Check the origin of the message to ensure it's from the popup window
*/
if (event.origin !== config.signInRedirectURL) return;
if (event.origin !== config.afterSignInUrl) return;

const {code, state} = event.data;

Expand All @@ -182,7 +182,7 @@ const SignIn: FC<SignInProps> = (props: SignInProps): ReactElement => {
authContext?.setAuthResponse(resp);

const authInstance: UIAuthClient = AuthClient.getInstance();
const state: string = (await authInstance.getDataLayer().getTemporaryDataParameter('state')).toString();
const state: string = (await authInstance.getStorageManager().getTemporaryDataParameter('state')).toString();

await authInstance.requestAccessToken(resp.authData.code, resp.authData.session_state, state);

Expand Down Expand Up @@ -368,7 +368,7 @@ const SignIn: FC<SignInProps> = (props: SignInProps): ReactElement => {
{showLogo && !(isLoading || authContext?.isComponentLoading) && (
<UISignIn.Image className="asgardeo-sign-in-logo" src={imgUrl} />
)}
{authContext?.authResponse?.flowStatus !== FlowStatus.SuccessCompleted && !isAuthenticated && (
{authContext?.authResponse?.flowStatus !== FlowStatus.SuccessCompleted && !isSignedIn && (
<>
{renderSignIn()}

Expand Down Expand Up @@ -397,7 +397,7 @@ const SignIn: FC<SignInProps> = (props: SignInProps): ReactElement => {
)}
</>
)}
{(authContext?.authResponse?.flowStatus === FlowStatus.SuccessCompleted || isAuthenticated) && (
{(authContext?.authResponse?.flowStatus === FlowStatus.SuccessCompleted || isSignedIn) && (
<div style={{backgroundColor: 'white', padding: '1rem'}}>Successfully Authenticated</div>
)}
</UISignIn>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import SignedProps from '../../models/signed-props';
*/
const SignedIn: FC<PropsWithChildren<SignedProps>> = (props: PropsWithChildren<SignedProps>) => {
const {fallback = null, children} = props;
const {isAuthenticated} = useAuthentication();
const {isSignedIn} = useAuthentication();

return isAuthenticated ? children : fallback;
return isSignedIn ? children : fallback;
};

export default SignedIn;
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ import SignedProps from '../../models/signed-props';
*/
const SignedOut: FC<PropsWithChildren<SignedProps>> = (props: PropsWithChildren<SignedProps>) => {
const {fallback = null, children} = props;
const {isAuthenticated} = useAuthentication();
const {isSignedIn} = useAuthentication();

return !isAuthenticated ? children : fallback;
return !isSignedIn ? children : fallback;
};

export default SignedOut;
6 changes: 3 additions & 3 deletions packages/__legacy__/react/src/hooks/use-authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,13 +26,13 @@ import UseAuthentication from '../models/use-authentication';
* `useAuthentication` is a custom hook that provides access to the authentication context.
* It returns an object containing the current user, the authentication status, the access token, and a sign out function.
*
* @returns {UseAuthentication} An object containing the current user (`user`), the authentication status (`isAuthenticated`),
* @returns {UseAuthentication} An object containing the current user (`user`), the authentication status (`isSignedIn`),
* the access token (`accessToken`), and a sign out function (`signOut`).
*/
const useAuthentication = (): UseAuthentication => {
const contextValue: AuthContext = useContext(AsgardeoContext);

const {accessToken, authResponse, isAuthenticated, isGlobalLoading, setUsername, user, username} = contextValue;
const {accessToken, authResponse, isSignedIn, isGlobalLoading, setUsername, user, username} = contextValue;

const signOut: () => void = () => {
signOutApiCall().then(() => {
Expand All @@ -46,7 +46,7 @@ const useAuthentication = (): UseAuthentication => {
return {
accessToken,
authResponse,
isAuthenticated,
isSignedIn,
isGlobalLoading,
setUsername,
signOut,
Expand Down
2 changes: 1 addition & 1 deletion packages/__legacy__/react/src/models/auth-context.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ interface AuthContext {
authResponse: AuthApiResponse;
config: UIAuthConfig;
isAuthLoading: boolean;
isAuthenticated: boolean | undefined;
isSignedIn: boolean | undefined;
isBrandingLoading: boolean;
isComponentLoading: boolean;
isGlobalLoading: boolean;
Expand Down
2 changes: 1 addition & 1 deletion packages/__legacy__/react/src/models/use-authentication.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import {AuthApiResponse, MeAPIResponse} from '@asgardeo/js';
interface UseAuthentication {
accessToken: string;
authResponse: AuthApiResponse;
isAuthenticated: Promise<boolean> | boolean;
isSignedIn: Promise<boolean> | boolean;
isGlobalLoading: boolean;
setUsername: (username: string) => void;
signOut: () => void;
Expand Down
Loading
Loading