Skip to content

Conversation

@brionmario
Copy link
Member

@brionmario brionmario commented Jun 17, 2025

Purpose

This pull request introduces several updates to the Asgardeo JavaScript SDKs, including new features, terminology updates, and internal refactoring. The most notable changes include the addition of a new SDK for Express.js, updates to improve consistency in naming conventions, and refactoring of the legacy core to use a new storage management system instead of the data layer.

Main Improvements

SiignIn

A comprehensive sign-in component that renders a complete sign-in interface with customizable styling and behavior.

Props
Prop Type Required Description
className string No CSS class name for styling the sign-in container
redirectUrl string No URL to redirect after successful sign-in
onSignInStart () => void No Callback fired when sign-in process starts
onSignInSuccess (user: User) => void No Callback fired when sign-in is successful
onSignInError (error: Error) => void No Callback fired when sign-in fails
buttonText string No Custom text for the sign-in button (defaults to "Sign In")
loadingText string No Text to show while signing in (defaults to "Signing in...")
disabled boolean No Whether the sign-in interface is disabled
Example
+ import { SignIn } from '@asgardeo/react';

const SignInPage = () => {
  const handleSignInSuccess = (user) => {
    console.log('User signed in:', user.username);
    // Redirect to dashboard or update UI
  };

  const handleSignInError = (error) => {
    console.error('Sign-in failed:', error.message);
    // Show error message to user
  };

  return (
    <div className="signin-container">
      <h1>Welcome Back</h1>
+       <SignIn 
+         className="custom-signin" // optional
+         onSignInSuccess={handleSignInSuccess} // optional
+         onSignInError={handleSignInError} // optional
+       />
    </div>
  );
};

export default SignInPage;

Customization: See Customization for comprehensive styling and theming options.

Available CSS Classes

  • .asgardeo-signin - Main sign-in container
  • .asgardeo-signin--small - Small size variant
  • .asgardeo-signin--large - Large size variant
  • .asgardeo-signin--outlined - Outlined variant
  • .asgardeo-signin--filled - Filled variant
  • .asgardeo-signin__input - Input field elements
  • .asgardeo-signin__input--small - Small input variant
  • .asgardeo-signin__input--large - Large input variant
  • .asgardeo-signin__button - Sign-in button element
  • .asgardeo-signin__button--small - Small button variant
  • .asgardeo-signin__button--large - Large button variant
  • .asgardeo-signin__button--outlined - Outlined button variant
  • .asgardeo-signin__button--filled - Filled button variant
  • .asgardeo-signin__error - Error message container
  • .asgardeo-signin__messages - Messages container

Other

New SDK Addition:
  • Added an Express.js SDK to the list of available SDKs in the README.md file. (README.md)

Naming Convention Updates:

  • Replaced signInRedirectURL with afterSignInUrl and clientID with clientId across documentation and code examples for improved consistency. (docs/src/react/components/asgardeo-provider.md, docs/src/react/introduction.md) [1] [2]
  • Updated the isAuthenticated property to isSignedIn in the useAuthentication hook and related components for clarity. (docs/src/react/hooks/use-authentication.md, packages/__legacy__/react/src/components/SignIn/SignIn.tsx, packages/__legacy__/react/src/components/SignedIn/SignedIn.tsx, packages/__legacy__/react/src/components/SignedOut/SignedOut.tsx) [1] [2] [3] [4] [5] [6]

Refactoring for Storage Management:

  • Replaced usage of the data layer with the storage manager for configuration and temporary data handling in the legacy core. (packages/__legacy__/core/src/api/authenticate.ts, packages/__legacy__/core/src/api/authorize.ts, packages/__legacy__/core/src/api/get-branding-preference-text.ts, packages/__legacy__/core/src/api/get-branding-preference.ts, packages/__legacy__/core/src/api/get-profile-information.ts, packages/__legacy__/core/src/api/sign-out.ts, packages/__legacy__/core/src/branding/get-branding.ts, packages/__legacy__/core/src/i18n/get-localization.ts, packages/__legacy__/react/src/components/SignIn/SignIn.tsx) [1] [2] [3] [4] [5] [6] [7] [8] [9]

Internal Codebase Updates:

  • Removed ResponseMode import and replaced its usage with a direct string value for simplification. (packages/__legacy__/core/src/auth-client.ts, packages/__legacy__/core/src/api/sign-out.ts) [1] [2] [3] [4]
  • Updated the repository metadata in package.json to reflect the new project structure. (package.json)

These updates enhance the SDK's usability, maintain consistency across the codebase, and improve internal architecture for better maintainability.

Related Issues

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 30 commits June 6, 2025 16:01
feat: implement utility function for class name merging using clsx and tailwind-merge

chore: configure Tailwind CSS with custom theme and extend default settings

fix: update TypeScript configuration for path aliases and improve type checking

chore: update Vite configuration to include Tailwind CSS plugin and path alias resolution
- Deleted the `authentication-core.ts` file which contained the core authentication logic.
- Removed the `index.ts` file that exported the authentication core.
- Updated the main index file to include `SessionData` from the models.
…Exception to errors directory and updating imports
…ew methods and refactor user information retrieval"

This reverts commit bbba841.
… creation page with mock authentication and organization data

Refactor: Update organizations page to use mock data and improve role handling

Refactor: Enhance profile page with mock user data and improve form handling

Cleanup: Remove unused authentication hooks and related functions

Cleanup: Delete unused authentication and session management logic

Cleanup: Remove Next.js configuration and PostCSS setup

Cleanup: Delete global CSS and Tailwind configuration files
…o authentication middleware

- Deleted unused UI components including Alert, Avatar, Badge, Button, Card, Checkbox, DropdownMenu, Input, Label, and Textarea.
- Removed the ThemeProvider and Header components.
- Deleted the mock authentication context and utility functions.
- Added Asgardeo authentication middleware for handling user authentication.
- Updated package.json to include Asgardeo dependencies and adjusted versions for other packages.
- Created an example .env.local file for configuration.
- Removed old Next.js configuration files and updated TypeScript configuration.
…, and node packages; bump react package version to 0.3.0
@brionmario brionmario merged commit e876890 into asgardeo:main Jun 17, 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.

feat: SignIn component for @asgardeo/react

2 participants