npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

aganitha-authentication-component

v1.9.0

Published

A beautiful and customizable authentication login UI component for React applications

Readme

React Auth Login UI

A beautiful and customizable authentication login UI component for React applications. This component provides a modern, responsive login interface with support for multiple authentication methods including:

  • Social Login (Google, GitHub, LinkedIn)
  • Email OTP Authentication
  • LDAP Authentication

Installation

npm install react-auth-login-ui
# or
yarn add react-auth-login-ui

Prerequisites

This package requires the following peer dependencies:

{
  "react": ">=16.8.0",
  "react-dom": ">=16.8.0",
  "next-auth": ">=4.0.0",
  "react-icons": ">=4.0.0"
}

Usage

import { AuthLogin } from 'react-auth-login-ui';

function App() {
  return (
    <AuthLogin
      title="Welcome"
      subtitle="Sign in to continue"
      showGoogle={true}
      showGithub={true}
      showLinkedin={true}
      showOTP={true}
      showLDAP={true}
      redirectUrl="/dashboard"
      ldapDomain="example.com"
    />
  );
}

Props

| Prop | Type | Default | Description | |------|------|---------|-------------| | className | string | "" | Additional CSS classes for the component | | redirectUrl | string | "/" | URL to redirect after successful login | | title | string | "Welcome to Aganitha" | Main title of the login page | | subtitle | string | "You can sign in using your preferred login method" | Subtitle text | | showGoogle | boolean | true | Show/hide Google login button | | showGithub | boolean | true | Show/hide GitHub login button | | showLinkedin | boolean | true | Show/hide LinkedIn login button | | showOTP | boolean | true | Show/hide Email OTP login option | | showLDAP | boolean | true | Show/hide LDAP login option | | buttonClassName | string | "" | Additional CSS classes for buttons | | containerClassName | string | "" | Additional CSS classes for container | | termsUrl | string | "#" | URL for Terms of Service | | privacyUrl | string | "#" | URL for Privacy Policy | | logoUrl | string | "https://www.aganitha.ai/..." | URL for the logo image | | logoClassName | string | "" | Additional CSS classes for logo | | ldapDomain | string | "" | Domain for LDAP authentication |

API Integration

Next.js API Routes

You'll need to set up the following API routes in your Next.js application:

  1. /api/auth/request-otp - For requesting OTP
  2. /api/auth/verify-otp - For verifying OTP

Example implementation for /api/auth/request-otp:

// pages/api/auth/request-otp.ts
import type { NextApiRequest, NextApiResponse } from 'next';

export default async function handler(req: NextApiRequest, res: NextApiResponse) {
  if (req.method !== 'POST') {
    return res.status(405).json({ error: 'Method not allowed' });
  }

  try {
    const { email } = req.body;
    // Implement your OTP generation and sending logic here
    const userId = 'generated-user-id';
    
    return res.status(200).json({ userId });
  } catch (error) {
    return res.status(500).json({ error: 'Failed to send OTP' });
  }
}

NextAuth.js Configuration

Configure NextAuth.js to support the authentication providers:

// pages/api/auth/[...nextauth].ts
import NextAuth from 'next-auth';
import GoogleProvider from 'next-auth/providers/google';
import GitHubProvider from 'next-auth/providers/github';
import LinkedInProvider from 'next-auth/providers/linkedin';

export default NextAuth({
  providers: [
    GoogleProvider({
      clientId: process.env.GOOGLE_ID,
      clientSecret: process.env.GOOGLE_SECRET,
    }),
    GitHubProvider({
      clientId: process.env.GITHUB_ID,
      clientSecret: process.env.GITHUB_SECRET,
    }),
    LinkedInProvider({
      clientId: process.env.LINKEDIN_ID,
      clientSecret: process.env.LINKEDIN_SECRET,
    }),
    // Add custom providers for OTP and LDAP
  ],
  // Add your NextAuth.js configuration
});

Styling

The component uses Tailwind CSS for styling. Make sure to include Tailwind CSS in your project:

npm install tailwindcss postcss autoprefixer
# or
yarn add tailwindcss postcss autoprefixer

License

MIT