diff --git a/.changeset/floppy-pandas-poke.md b/.changeset/floppy-pandas-poke.md new file mode 100644 index 00000000..25c40e11 --- /dev/null +++ b/.changeset/floppy-pandas-poke.md @@ -0,0 +1,5 @@ +--- +'@asgardeo/react': patch +--- + +Refactor AsgardeoReactClient initialization to fix the type issue diff --git a/packages/nextjs/.eslintrc.cjs b/packages/nextjs/.eslintrc.cjs index 71ced706..9ec2bc21 100644 --- a/packages/nextjs/.eslintrc.cjs +++ b/packages/nextjs/.eslintrc.cjs @@ -1,5 +1,5 @@ /** - * Copyright (c) 2025, WSO2 LLC. (https://www.wso2.com). + * Copyright (c) 2025-2026, WSO2 LLC. (https://www.wso2.com). * * WSO2 LLC. licenses this file to you under the Apache License, * Version 2.0 (the "License"); you may not use this file except @@ -36,6 +36,9 @@ module.exports = { project: [path.resolve(__dirname, 'tsconfig.eslint.json')], }, plugins: ['@wso2'], + rules: { + '@typescript-eslint/return-await': 'off', + }, settings: { 'import/resolver': { node: { diff --git a/packages/react/src/AsgardeoReactClient.ts b/packages/react/src/AsgardeoReactClient.ts index d7aa30c4..c423e214 100644 --- a/packages/react/src/AsgardeoReactClient.ts +++ b/packages/react/src/AsgardeoReactClient.ts @@ -126,14 +126,13 @@ class AsgardeoReactClient e } return this.withLoading(async () => { - this.initializeConfig = { - ...config, - organizationHandle: resolvedOrganizationHandle, - periodicTokenRefresh: config?.tokenLifecycle?.refreshToken?.autoRefresh - ?? (config as any)?.periodicTokenRefresh, - }; - - return this.asgardeo.init(this.initializeConfig as any); + this.initializeConfig = {...config, organizationHandle: resolvedOrganizationHandle}; + + return this.asgardeo.init({ + ...this.initializeConfig, + periodicTokenRefresh: + config?.tokenLifecycle?.refreshToken?.autoRefresh ?? (config as any)?.periodicTokenRefresh, + } as any); }); }