Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
96 commits
Select commit Hold shift + click to select a range
4f42f36
fix: simplify SignIn component usage in API documentation
brionmario Jun 17, 2025
5d28d1c
ci(samples): add initial vercel configuration for rewrites
brionmario Jun 17, 2025
02f4bff
chore(react): enhance UserDropdown and BaseUserDropdown with loading …
brionmario Jun 17, 2025
0530089
fix(react): update BaseUserDropdown to use Typography component and i…
brionmario Jun 17, 2025
6bd4f01
feat(react): enhance BaseUserDropdown with profile management and sig…
brionmario Jun 17, 2025
36077d8
feat(react): enhance UserDropdown with additional menu items and icons
brionmario Jun 17, 2025
0e05c93
feat(react): enhance UserDropdown with custom rendering options and i…
brionmario Jun 17, 2025
7812d5e
feat(react): add error code convention documentation and implement em…
brionmario Jun 17, 2025
cd1f24c
feat(react): refactor embedded flow types and update response handlin…
brionmario Jun 17, 2025
a73fbe5
feat(react): implement embedded sign-up flow with error handling and …
brionmario Jun 17, 2025
33f1cf5
feat(react): add BaseSignUp and SignUp components for embedded sign-u…
brionmario Jun 17, 2025
53e5d76
feat(react): implement SignIn component for native authentication flo…
brionmario Jun 17, 2025
ecdc6d6
chore: add `afterSignOutUrl`
brionmario Jun 17, 2025
8f4aa22
feat(react): add afterSignOutUrl to configuration and update related …
brionmario Jun 17, 2025
cf2d066
feat(react): update scopes in AsgardeoProvider for enhanced user perm…
brionmario Jun 17, 2025
ed2eb72
feat(react): enhance user profile handling and improve attribute mapp…
brionmario Jun 17, 2025
48c311b
feat(react): implement SignIn component for native authentication flo…
brionmario Jun 19, 2025
925ced1
fix: reorder url property in EmbeddedSignUpFlowExecuteRequestConfig f…
brionmario Jun 19, 2025
02952d5
feat(react): make onInitialize and onSubmit props optional in BaseSig…
brionmario Jun 19, 2025
5642125
feat(react): enhance Asgardeo context and components with initializat…
brionmario Jun 19, 2025
3d91761
feat(react): implement sign-up flow components including EmailInput, …
brionmario Jun 19, 2025
aa88400
fix: reorder import statements in EmailInput, PasswordInput, and Text…
brionmario Jun 19, 2025
dc23c0e
feat(react): add SocialButton component for sign-up options and updat…
brionmario Jun 19, 2025
b422594
feat(react): add GoogleButton component and integrate it into sign-up…
brionmario Jun 19, 2025
aa6a059
feat(react): refactor form submission handling in sign-up components …
brionmario Jun 19, 2025
a9ee166
fix: simplify formatting of submit button search logic in FormContain…
brionmario Jun 19, 2025
f7f3d6f
feat(react): update typography styles and simplify form layout in sig…
brionmario Jun 19, 2025
ac2d692
feat(react): add new input components (Checkbox, Date, Number, Teleph…
brionmario Jun 19, 2025
c77dd06
feat(react): refactor button handling in sign-up components to use a …
brionmario Jun 19, 2025
a035655
feat(react): update sign-in and landing pages to use SignInButton and…
brionmario Jun 19, 2025
a859677
feat(react): enable validation on change in BaseSignUp component and …
brionmario Jun 19, 2025
1f47944
feat(react): filter out empty or undefined input values in BaseSignUp…
brionmario Jun 19, 2025
bd65662
chore(react): update documentation comments in SignUp and BaseSignUp …
brionmario Jun 19, 2025
a47c831
chore(react): remove unused SignUpButton import in PublicActions comp…
brionmario Jun 19, 2025
b1ec9c0
feat(react): add X icon component and integrate it into Popover for c…
brionmario Jun 19, 2025
2fee1d0
feat(react): add Loaded and Loading components for handling loading s…
brionmario Jun 19, 2025
b0dfd0b
feat(react): refactor UserDropdown and UserProfile components to stre…
brionmario Jun 19, 2025
9d0ee21
feat(react): enhance BaseUserProfile with dynamic field placeholders …
brionmario Jun 19, 2025
8dcb502
feat(react): add dynamic placeholders to input fields in BaseUserProf…
brionmario Jun 19, 2025
8b217f3
feat(react): integrate UserProfile component into Profile page; refac…
brionmario Jun 19, 2025
26d661a
feat(react): add fieldsToSkip array to BaseUserProfile for filtering …
brionmario Jun 19, 2025
a78ec53
feat(react): enhance BaseUserProfile to support SCIM patch operations…
brionmario Jun 19, 2025
bc05584
feat(react): include additional fields in generateFlattenedUserProfil…
brionmario Jun 19, 2025
647f6e6
feat(react): add onComplete callback and shouldRedirectAfterSignUp pr…
brionmario Jun 19, 2025
4529acd
feat: add @asgardeo/react-router package with authentication componen…
brionmario Jun 19, 2025
5d72d89
feat(react): add SignIn route and enhance ProtectedRoute component fo…
brionmario Jun 19, 2025
0aee96f
feat(react): integrate ProtectedRoute for secure access to dashboard …
brionmario Jun 19, 2025
37d1a31
feat: add Vite + React + TypeScript sample
brionmario Jun 19, 2025
9b35361
feat: Enhance OIDC request handling and improve sign-in/sign-out comp…
brionmario Jun 19, 2025
5a8d2f2
feat: refactor authentication flow to use Embedded Sign-In components…
brionmario Jun 19, 2025
20d6b9f
feat: refactor authentication flow to use embedded sign-in components…
brionmario Jun 19, 2025
7404f80
feat: introduce AsgardeoLoading component and remove Loaded component…
brionmario Jun 19, 2025
3c7cb0c
feat: Add OrganizationSwitcher component with context integration
brionmario Jun 20, 2025
49b41b3
feat(react): Update border radius to medium for various components
brionmario Jun 20, 2025
584377f
feat: Refactor Avatar component to improve props structure and render…
brionmario Jun 20, 2025
2fcfbdb
chore(javascript): add VendorConstants and withVendorCSSClassPrefix u…
brionmario Jun 20, 2025
aede0d7
feat(nextjs): Add getOrganizations method to AsgardeoNextClient with …
brionmario Jun 20, 2025
48d58b3
feat: Add withVendorCSSClassPrefix utility to index exports
brionmario Jun 20, 2025
60cdfdd
fix(react): Update placement of floating elements in BaseOrganization…
brionmario Jun 20, 2025
6581364
feat(i18n): Add organization switcher translations and integrate into…
brionmario Jun 20, 2025
bf44d80
feat(react): Implement organization creation functionality with UI an…
brionmario Jun 20, 2025
98cb95b
feat(i18n): Add organization handle translations and update CreateOrg…
brionmario Jun 22, 2025
3698753
feat(react): Enhance Avatar component with customizable background ge…
brionmario Jun 22, 2025
1ac1a73
feat(react): Update organization model and enhance getMeOrganizations…
brionmario Jun 23, 2025
8c67848
chore: replace IdTokenPayload with IdToken across the codebase
brionmario Jun 23, 2025
8dd0616
feat(react): Implement organization switching functionality across th…
brionmario Jun 23, 2025
a0f95cb
feat(react): Enhance sign-up flow with redirection handling for both …
brionmario Jun 23, 2025
d9d448c
feat(react): Enhance theme configuration with success and warning col…
brionmario Jun 23, 2025
5637352
chore(javascript): Refactor theme types to improve structure and add …
brionmario Jun 23, 2025
63b61b4
feat(react): Add organization management functionality and profile di…
brionmario Jun 23, 2025
118b1a9
feat(react): Refactor organization creation and profile pages, update…
brionmario Jun 23, 2025
e8edb2d
feat(react): Implement organization management functionality with pag…
brionmario Jun 24, 2025
e92d1e9
chore(react): Refactor BaseOrganizationList props for improved organi…
brionmario Jun 24, 2025
8a87a9e
feat(react): Add organization management translations and loading/err…
brionmario Jun 24, 2025
c5119d4
feat(react): Enhance organization management with popup support in Ba…
brionmario Jun 24, 2025
5a872aa
feat(react): Refactor organization management to use enhanced Organiz…
brionmario Jun 24, 2025
5cd7d7b
feat(react): Update organization management translations and enhance …
brionmario Jun 24, 2025
a6d1c5d
feat(react): Enhance organization management with new translations, i…
brionmario Jun 24, 2025
db9c419
feat(react): Add isEmpty utility function and update organization man…
brionmario Jun 24, 2025
83bf5a4
feat(react): Implement KeyValueInput component for managing key-value…
brionmario Jun 24, 2025
a2a7b40
chore(samples): update teamspace nextjs sample
brionmario Jun 24, 2025
e15b559
feat(react): Add Header component with authentication-based navigatio…
brionmario Jun 24, 2025
f0317a4
chore(samples): refactor header components and improve profile page f…
brionmario Jun 24, 2025
53f608c
feat(react): Enhance sign-in flow with embedded support and update re…
brionmario Jun 24, 2025
b20fe98
feat(auth): Add clientSecret to authorization parameters and update A…
brionmario Jun 24, 2025
90b43c4
feat(nextjs): Add logging for configuration data and embedded sign-in…
brionmario Jun 24, 2025
398ff43
chore: authentication flow and UI components
brionmario Jun 25, 2025
bed4da6
docs: add Quickstart guide for integrating Asgardeo authentication in…
brionmario Jun 25, 2025
9431713
docs: update placeholders in Quickstart guide for clarity
brionmario Jun 25, 2025
0d25aa5
docs: update Quickstart guide to use 'react-sample' as the applicatio…
brionmario Jun 25, 2025
dc29ce8
docs: add user information display in the Quickstart guide example
brionmario Jun 25, 2025
4d0f4c9
docs: update Quickstart guide to include User component in App example
brionmario Jun 25, 2025
06e9a59
docs: update Quickstart guide for React to include User component exa…
brionmario Jun 25, 2025
3aa86ce
docs: add real-dolls-build.md to introduce SignUp & B2B components
brionmario Jun 25, 2025
f2ed1a6
chore(react): add header components including AuthenticatedActions, A…
brionmario Jun 25, 2025
e1389a7
fix(react): make onInitialize and onSubmit props optional
brionmario Jun 25, 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
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions .changeset/real-dolls-build.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
'@asgardeo/react': minor
---

Introduce `SignUp` & B2B components.
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -43,4 +43,6 @@ Thumbs.db

# Environment files
*.env
.env*
.env*
.cursor/rules/nx-rules.mdc
.github/instructions/nx.instructions.md
31 changes: 11 additions & 20 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -1,22 +1,13 @@
{
"conventionalCommits.scopes": [
"workspace",
"core",
"react",
"auth-components",
"sample-app",
"docs"
],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"css.validate": false,
"less.validate": false,
"scss.validate": false,
"stylelint.validate": [
"css",
"scss"
],
"typescript.tsdk": "node_modules/typescript/lib",
"editor.formatOnSave": true
"conventionalCommits.scopes": ["workspace", "core", "react", "auth-components", "sample-app", "docs"],
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
},
"css.validate": false,
"less.validate": false,
"scss.validate": false,
"stylelint.validate": ["css", "scss"],
"typescript.tsdk": "node_modules/typescript/lib",
"editor.formatOnSave": true,
"nxConsole.generateAiAgentRules": true
}
154 changes: 154 additions & 0 deletions ERROR_CODES.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,154 @@
# Error Code Convention

## Overview
This document defines the error code convention used throughout the Asgardeo JavaScript SDK to ensure consistency and maintainability.

## Format
Error codes follow this format:
```
[{packageName}-]{functionName}-{ErrorCategory}-{SequentialNumber}
```

### Components

#### 1. Package Name (Optional)
- Use when the function might exist in multiple packages or when disambiguation is needed
- Use the package identifier (e.g., "javascript", "react", "node")
- Examples: `javascript-`, `react-`, `node-`

#### 2. Function Name
- Use the exact function name as defined in the code
- Use camelCase format matching the function declaration
- Examples: `getUserInfo`, `executeEmbeddedSignUpFlow`, `initializeEmbeddedSignInFlow`

#### 3. Error Category
Categories represent the type of error:

- **ValidationError**: Input validation failures, missing required parameters, invalid parameter values
- **ResponseError**: HTTP response errors, network failures, server errors
- **ConfigurationError**: Configuration-related errors, missing configuration, invalid settings
- **AuthenticationError**: Authentication-specific errors, token issues, credential problems
- **AuthorizationError**: Authorization-specific errors, permission denied, access control
- **NetworkError**: Network connectivity issues, timeout errors
- **ParseError**: JSON parsing errors, response format issues

#### 4. Sequential Number
- Three-digit zero-padded format: `001`, `002`, `003`, etc.
- Start from `001` for each function
- Increment sequentially within each function
- Group by error category for readability

## Numbering Strategy

For each function, allocate number ranges by category:
- **001-099**: ValidationError
- **100-199**: ResponseError
- **200-299**: ConfigurationError
- **300-399**: AuthenticationError
- **400-499**: AuthorizationError
- **500-599**: NetworkError
- **600-699**: ParseError

## Package Prefix Guidelines

Use the package prefix when:
1. **Multi-package scenarios**: When the same function name exists across different packages
2. **Public APIs**: For functions that are part of the public API and might be referenced externally
3. **Complex projects**: In large codebases where disambiguation aids debugging and maintenance

Examples of when to use prefixes:
- `javascript-executeEmbeddedSignUpFlow-ValidationError-001` (public API function)
- `react-useAuth-ConfigurationError-201` (React-specific hook)
- `node-createServer-NetworkError-501` (Node.js-specific function)

## Examples

### With Package Prefix (Recommended for Public APIs)
```typescript
// executeEmbeddedSignUpFlow Function (JavaScript package)
'javascript-executeEmbeddedSignUpFlow-ValidationError-001' // Missing payload
'javascript-executeEmbeddedSignUpFlow-ValidationError-002' // Invalid flowType
'javascript-executeEmbeddedSignUpFlow-ResponseError-100' // HTTP error response
```

### Without Package Prefix (Internal/Simple Functions)
```typescript
// getUserInfo Function (internal utility)
'getUserInfo-ValidationError-001' // Invalid URL
'getUserInfo-ValidationError-002' // Missing access token
'getUserInfo-ResponseError-100' // HTTP error response
'getUserInfo-ResponseError-101' // Invalid response format
```

## Implementation Guidelines

1. **Consistency**: Always use the exact function name in error codes
2. **Package Prefix**: Use package prefixes for public APIs and when disambiguation is needed
3. **Documentation**: Document each error code with clear description
4. **Categorization**: Choose the most appropriate category for each error
5. **Numbering**: Use the range-based numbering system for better organization
6. **Future-proofing**: Leave gaps in numbering for future error codes

## Current Implementation Status

### Updated Functions (Following New Convention)
- ✅ `executeEmbeddedSignUpFlow` - Uses `javascript-` prefix with range-based numbering

### Functions Needing Updates
- ⏳ `getUserInfo` - Currently uses simple format, needs prefix evaluation
- ⏳ `initializeEmbeddedSignInFlow` - Currently uses simple format, needs prefix evaluation
- ⏳ `executeEmbeddedSignInFlow` - Currently uses simple format, needs prefix evaluation

## Migration Notes

When updating existing error codes:
1. **Evaluate prefix necessity**: Determine if the function needs a package prefix
2. **Update numbering**: Move to range-based numbering (ValidationError: 001-099, ResponseError: 100-199, etc.)
3. **Update tests**: Ensure all tests use the new error codes
4. **Update documentation**: Document the new error codes
5. **Consider backward compatibility**: If codes are exposed in public APIs, plan migration strategy

## Example Migration

### Before (Old Convention)
```typescript
'getUserInfo-ValidationError-001'
'getUserInfo-ResponseError-001'
```

### After (New Convention)
```typescript
// Option 1: With prefix (for public API)
'javascript-getUserInfo-ValidationError-001'
'javascript-getUserInfo-ResponseError-100'

// Option 2: Without prefix (for internal use)
'getUserInfo-ValidationError-001'
'getUserInfo-ResponseError-100'
```

## Current Error Code Registry

### executeEmbeddedSignUpFlow (Updated - New Convention)
- `javascript-executeEmbeddedSignUpFlow-ValidationError-001` - Missing payload
- `javascript-executeEmbeddedSignUpFlow-ValidationError-002` - Invalid flowType
- `javascript-executeEmbeddedSignUpFlow-ResponseError-100` - HTTP error response

### getUserInfo (Legacy Format)
- `getUserInfo-ValidationError-001` - Invalid endpoint URL
- `getUserInfo-ResponseError-001` - Failed to fetch user info

### initializeEmbeddedSignInFlow (Legacy Format)
- `initializeEmbeddedSignInFlow-ValidationError-002` - Missing authorization payload
- `initializeEmbeddedSignInFlow-ResponseError-001` - Authorization request failed

### executeEmbeddedSignInFlow (Legacy Format)
- `executeEmbeddedSignInFlow-ValidationError-002` - Missing required parameter
- `initializeEmbeddedSignInFlow-ResponseError-001` - Response error (Note: incorrect function name reference)

## Recommended Actions

1. **Standardize numbering**: Update legacy functions to use range-based numbering
2. **Fix inconsistencies**: Correct the error code in `executeEmbeddedSignInFlow` that references the wrong function
3. **Add prefixes**: Evaluate which functions need package prefixes based on their public API status
4. **Document usage**: Add inline documentation in each file listing the error codes used
4 changes: 2 additions & 2 deletions packages/browser/src/__legacy__/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ import {
IsomorphicCrypto,
TokenExchangeRequestConfig,
StorageManager,
IdTokenPayload,
IdToken,
OIDCEndpoints,
User,
} from '@asgardeo/javascript';
Expand Down Expand Up @@ -737,7 +737,7 @@ export class AsgardeoSPAClient {
*
* @preserve
*/
public async getDecodedIdToken(): Promise<IdTokenPayload | undefined> {
public async getDecodedIdToken(): Promise<IdToken | undefined> {
await this._validateMethod();

return this._client?.getDecodedIdToken();
Expand Down
Loading
Loading