Skip to content

Conversation

@brionmario
Copy link
Member

@brionmario brionmario commented Jul 1, 2025

Purpose

This pull request introduces several updates across multiple files, focusing on improving session management, adding theme detection capabilities, enhancing API request handling, and expanding functionality in the JavaScript client. Below is a categorized summary of the most important changes.

Session Management Updates

  • Modified the getDecodedIdToken method across multiple files (client.ts, main-thread-client.ts, web-worker-client.ts, authentication-helper.ts, client.ts, web-worker.ts, worker-core.ts) to accept an optional sessionId parameter, enabling session-specific token decoding. [1] [2] [3] [4] [5] [6] [7] [8]

Theme Detection Features

  • Added a new themeDetection.ts file that introduces utilities for browser-based theme detection, including methods for detecting theme mode (detectThemeMode), observing class changes (createClassObserver), and listening to media query changes (createMediaQueryListener).
  • Exported theme detection utilities from the index.ts file to make them accessible throughout the application.

API Enhancements

  • Updated API request handling in multiple files (createOrganization.ts, executeEmbeddedSignInFlow.ts, executeEmbeddedSignUpFlow.ts, getAllOrganizations.ts) to ensure requestConfig is properly spread for better flexibility and customization of headers and other configurations. [1] [2] [3] [4]
  • Added logging for errors in the createOrganization function to improve debugging capabilities.

JavaScript Client Updates

  • Enhanced the AsgardeoJavaScriptClient class to support optional parameters for methods like getUser, getOrganizations, getCurrentOrganization, and getUserProfile, and added a new method updateUserProfile. These changes improve flexibility and allow session-specific or user-specific operations.

Branding Preference Test Addition

  • Added comprehensive tests for the getBrandingPreference API, covering successful fetches, query parameter handling, custom fetchers, error scenarios (invalid URLs, HTTP errors, network errors), and custom headers.

Related Issues

  • N/A

Related PRs

  • N/A

Checklist

  • e2e cypress tests locally verified.
  • Manual test round performed and verified.
  • UX/UI review done on the final implementation.
  • Documentation provided. (Add links if there are any)
  • Unit tests provided. (Add links if there are any)
  • Integration tests provided. (Add links if there are any)

Security checks

brionmario added 19 commits July 1, 2025 08:50
…nal parameters for user and organization methods
JayaShakthi97
JayaShakthi97 previously approved these changes Jul 2, 2025
NipuniBhagya
NipuniBhagya previously approved these changes Jul 2, 2025
@brionmario brionmario dismissed stale reviews from NipuniBhagya and JayaShakthi97 via e4ecf2e July 2, 2025 04:22
@brionmario brionmario merged commit 9220af7 into asgardeo:main Jul 2, 2025
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants