Skip to content

Commit 7f86393

Browse files
authored
Merge pull request #217 from brionmario/thunder
fix: `SignInButton` issue with `AsgardeoV2`
2 parents 109368a + 218f930 commit 7f86393

File tree

5 files changed

+17
-4
lines changed

5 files changed

+17
-4
lines changed

.changeset/lazy-forks-sneeze.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
---
2+
'@asgardeo/react': patch
3+
'@asgardeo/javascript': patch
4+
---
5+
6+
Fix `SignInButton` issue with `AsgardeoV2`

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,14 @@ Follow these simple steps to get started with Asgardeo:
4848

4949
Please read [Contributing Guide](CONTRIBUTING.md) for details on how to contribute to Asgardeo JavaScript SDKs. Refer to [General Contribution Guidelines](http://wso2.github.io/) for details on our code of conduct, and the process for submitting pull requests to us.
5050

51+
### Contributors ❤️
52+
53+
Hats off to all the people who have contributed to this project, including those who created issues and participated in discussions. 🙌
54+
55+
<a href="https://github.com/asgardeo/javascript/graphs/contributors">
56+
<img src="https://contrib.rocks/image?repo=asgardeo/javascript" />
57+
</a>
58+
5159
### Reporting issues
5260

5361
We encourage you to report issues, improvements, and feature requests creating [Github Issues](https://github.com/asgardeo/javascript/issues).

packages/javascript/src/models/embedded-flow.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,6 @@
1616
* under the License.
1717
*/
1818

19-
import {Platform} from './platforms';
20-
2119
export enum EmbeddedFlowType {
2220
Authentication = 'AUTHENTICATION',
2321
Registration = 'REGISTRATION',

packages/react/src/AsgardeoReactClient.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ import {
4848
Config,
4949
TokenExchangeRequestConfig,
5050
Platform,
51+
isEmpty,
5152
} from '@asgardeo/browser';
5253
import AuthAPI from './__temp__/api';
5354
import getMeOrganizations from './api/getMeOrganizations';
@@ -334,7 +335,7 @@ class AsgardeoReactClient<T extends AsgardeoReactConfig = AsgardeoReactConfig> e
334335

335336
const config: AsgardeoReactConfig = (await this.asgardeo.getConfigData()) as AsgardeoReactConfig;
336337

337-
if (config.platform === Platform.AsgardeoV2) {
338+
if (config.platform === Platform.AsgardeoV2 && typeof arg1 === 'object' && !isEmpty(arg1)) {
338339
const sessionDataKey: string = new URL(window.location.href).searchParams.get('sessionDataKey');
339340

340341
return executeEmbeddedSignInFlowV2({

packages/react/src/contexts/Asgardeo/AsgardeoProvider.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -346,7 +346,7 @@ const AsgardeoProvider: FC<PropsWithChildren<AsgardeoProviderProps>> = ({
346346
useEffect(() => {
347347
// TEMPORARY: Asgardeo V2 platform does not support branding preference yet.
348348
// Tracker: https://github.com/asgardeo/javascript/issues/212
349-
if (config.platform !== Platform.AsgardeoV2) {
349+
if (config.platform === Platform.AsgardeoV2) {
350350
return;
351351
}
352352

0 commit comments

Comments
 (0)