diff --git a/.changeset/README.md b/.changeset/README.md new file mode 100644 index 0000000..e5b6d8d --- /dev/null +++ b/.changeset/README.md @@ -0,0 +1,8 @@ +# Changesets + +Hello and welcome! This folder has been automatically generated by `@changesets/cli`, a build tool that works +with multi-package repos, or single-package repos to help you version and publish your code. You can +find the full documentation for it [in our repository](https://github.com/changesets/changesets) + +We have a quick list of common questions to get you started engaging with this project in +[our documentation](https://github.com/changesets/changesets/blob/main/docs/common-questions.md) diff --git a/.changeset/config.json b/.changeset/config.json new file mode 100644 index 0000000..b821332 --- /dev/null +++ b/.changeset/config.json @@ -0,0 +1,11 @@ +{ + "$schema": "https://unpkg.com/@changesets/config@3.1.2/schema.json", + "changelog": "@changesets/cli/changelog", + "commit": false, + "fixed": [], + "linked": [], + "access": "public", + "baseBranch": "main", + "updateInternalDependencies": "patch", + "ignore": [] +} diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml new file mode 100644 index 0000000..dbf8dde --- /dev/null +++ b/.github/workflows/publish.yml @@ -0,0 +1,68 @@ +name: Publish Packages + +permissions: + contents: write + pull-requests: write + id-token: write # Required for npm provenance + +on: + push: + branches: + - main + +concurrency: ${{ github.workflow }}-${{ github.ref }} + +jobs: + release: + name: Release + runs-on: ubuntu-latest + steps: + - name: Checkout repository + uses: actions/checkout@v4 + with: + # Fetch full history for changesets + fetch-depth: 0 + + - name: Setup pnpm + uses: pnpm/action-setup@v4 + + - name: Setup Node.js + uses: actions/setup-node@v4 + with: + node-version: '18' + cache: 'pnpm' + registry-url: 'https://registry.npmjs.org' + + - name: Install dependencies + run: pnpm install --frozen-lockfile + + - name: Build packages + run: pnpm build + + - name: Run tests + run: pnpm test + + - name: Create Release Pull Request or Publish to npm + id: changesets + uses: changesets/action@v1 + with: + # Creates a "Version Packages" PR when changesets are added + version: pnpm changeset version + # Publishes packages when version PR is merged + # Using --provenance for npm Trusted Publishers + publish: pnpm changeset publish --provenance + # Commit message for version PR + commit: 'chore: version packages' + # Title for version PR + title: 'chore: version packages' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }} # Optional: fallback if trusted publishing not configured + + - name: Create GitHub Release + if: steps.changesets.outputs.published == 'true' + run: | + echo "Packages published:" + echo "${{ steps.changesets.outputs.publishedPackages }}" + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 0000000..a56b23d --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,206 @@ +# Contributing to @vector-institute/aieng-auth + +Thank you for your interest in contributing! This guide will help you get started. + +## Development Setup + +1. **Clone the repository** + + ```bash + git clone https://github.com/VectorInstitute/aieng-auth.git + cd aieng-auth + ``` + +2. **Install dependencies** + + ```bash + pnpm install + ``` + +3. **Build packages** + + ```bash + pnpm build + ``` + +4. **Run tests** + ```bash + pnpm test + ``` + +## Project Structure + +``` +aieng-auth/ +├── packages/ +│ ├── core/ # @vector-institute/aieng-auth-core +│ ├── react/ # @vector-institute/aieng-auth-react +│ └── eslint-config/ # Shared ESLint configuration +├── apps/ +│ ├── demo-react/ # React SPA demo +│ └── demo-nextjs/ # Next.js demo +└── .changeset/ # Changeset configuration +``` + +## Making Changes + +### 1. Create a Feature Branch + +```bash +git checkout -b feature/your-feature-name +``` + +### 2. Make Your Changes + +- Write clear, documented code +- Follow the existing code style +- Add tests for new functionality +- Ensure all tests pass: `pnpm test` + +### 3. Create a Changeset + +Changesets document what changed and determine version bumps. Create one after making your changes: + +```bash +pnpm changeset +``` + +You'll be prompted to: + +1. **Select packages** - Choose which packages changed (use spacebar to select): + - `@vector-institute/aieng-auth-core` - if you modified the core OAuth client + - `@vector-institute/aieng-auth-react` - if you modified React components/hooks + - Both - if changes affect both packages + +2. **Select bump type**: + - **patch** (0.0.x) - Bug fixes, documentation updates + - **minor** (0.x.0) - New features, non-breaking changes + - **major** (x.0.0) - Breaking changes + +3. **Write a summary** - Describe what changed (this appears in the changelog): + + ``` + Added support for custom OAuth scopes + + Users can now pass a `scopes` array to the auth config to request + additional OAuth scopes beyond the default profile and email. + ``` + +### 4. Commit and Push + +```bash +git add . +git commit -m "feat: add custom OAuth scopes support" +git push origin feature/your-feature-name +``` + +### 5. Open a Pull Request + +- Provide a clear description of your changes +- Reference any related issues +- Ensure CI checks pass + +## Changeset Guidelines + +### When to Create a Changeset + +✅ **Always create a changeset for:** + +- New features +- Bug fixes +- Breaking changes +- API changes +- Performance improvements + +❌ **Skip changeset for:** + +- Documentation-only changes +- Test improvements with no code changes +- Internal refactoring with no user-facing changes +- CI/CD configuration updates + +### Changeset Examples + +**Bug Fix (patch):** + +```markdown +Fixed token refresh failing when offline + +The OAuth client now properly handles network errors during token +refresh and retries with exponential backoff. +``` + +**New Feature (minor):** + +```markdown +Added ProtectedRoute component + +New ProtectedRoute component redirects unauthenticated users to +login page and supports custom redirect paths. +``` + +**Breaking Change (major):** + +````markdown +BREAKING: Changed AuthProvider config structure + +The `config` prop now uses a flat structure instead of nested +objects. Update your code: + +Before: + +```tsx + +``` +```` + +After: + +```tsx + +``` + +```` + +## Code Style + +- **TypeScript** - All code must be TypeScript with proper types +- **ESLint** - Run `pnpm lint:fix` to auto-fix issues +- **Prettier** - Run `pnpm format` to format code +- **Tests** - Write tests using Jest and React Testing Library + +## Testing + +```bash +# Run all tests +pnpm test + +# Run tests in watch mode +pnpm test:watch + +# Run tests with coverage +pnpm test -- --coverage +```` + +## Release Process + +The release process is automated using GitHub Actions and [npm Trusted Publishers](https://docs.npmjs.com/trusted-publishers): + +1. **Developer creates changeset** and includes it in their PR +2. **PR is merged to main** +3. **GitHub Action runs** and creates a "Version Packages" PR +4. **Maintainer reviews** the version bumps and changelog +5. **Version PR is merged** +6. **GitHub Action publishes** packages to npm automatically using provenance + +**Note**: Trusted Publishers must be configured on npm first (maintainers only). See the README for setup instructions. + +## Questions? + +- Open an issue for bugs or feature requests +- Check existing issues before creating new ones +- Join our discussions for questions and ideas + +## License + +By contributing, you agree that your contributions will be licensed under the Apache License 2.0. diff --git a/README.md b/README.md index a40bac1..b6ee892 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,14 @@ -# @aieng-auth +# @vector-institute/aieng-auth + +[![Code Checks](https://github.com/VectorInstitute/aieng-auth/actions/workflows/code_checks.yml/badge.svg)](https://github.com/VectorInstitute/aieng-auth/actions/workflows/code_checks.yml) +[![Unit Tests](https://github.com/VectorInstitute/aieng-auth/actions/workflows/unit_tests.yml/badge.svg)](https://github.com/VectorInstitute/aieng-auth/actions/workflows/unit_tests.yml) +[![Publish](https://github.com/VectorInstitute/aieng-auth/actions/workflows/publish.yml/badge.svg)](https://github.com/VectorInstitute/aieng-auth/actions/workflows/publish.yml) +[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://opensource.org/licenses/Apache-2.0) + +[![npm version - core](https://img.shields.io/npm/v/@vector-institute/aieng-auth-core?label=core&color=cb3837)](https://www.npmjs.com/package/@vector-institute/aieng-auth-core) +[![npm version - react](https://img.shields.io/npm/v/@vector-institute/aieng-auth-react?label=react&color=cb3837)](https://www.npmjs.com/package/@vector-institute/aieng-auth-react) +[![npm downloads - core](https://img.shields.io/npm/dm/@vector-institute/aieng-auth-core?label=core%20downloads)](https://www.npmjs.com/package/@vector-institute/aieng-auth-core) +[![npm downloads - react](https://img.shields.io/npm/dm/@vector-institute/aieng-auth-react?label=react%20downloads)](https://www.npmjs.com/package/@vector-institute/aieng-auth-react) Production-ready Google OAuth SSO for Vector internal web applications. @@ -11,8 +21,8 @@ Production-ready Google OAuth SSO for Vector internal web applications. ## Packages -- `@aieng-auth/core` - Framework-agnostic OAuth client with PKCE -- `@aieng-auth/react` - React hooks and components (AuthProvider, useAuth, ProtectedRoute) +- `@vector-institute/aieng-auth-core` - Framework-agnostic OAuth client with PKCE +- `@vector-institute/aieng-auth-react` - React hooks and components (AuthProvider, useAuth, ProtectedRoute) - `demo-react` - Client-side OAuth demo with React SPA - `demo-nextjs` - Server-side OAuth demo with Next.js App Router @@ -21,13 +31,13 @@ Production-ready Google OAuth SSO for Vector internal web applications. ### 1. Install ```bash -pnpm add @aieng-auth/react +pnpm add @vector-institute/aieng-auth-react ``` ### 2. Wrap Your App ```tsx -import { AuthProvider } from '@aieng-auth/react'; +import { AuthProvider } from '@vector-institute/aieng-auth-react'; const authConfig = { clientId: 'YOUR_GOOGLE_CLIENT_ID.apps.googleusercontent.com', @@ -47,7 +57,7 @@ function App() { ### 3. Use Authentication ```tsx -import { useAuth } from '@aieng-auth/react'; +import { useAuth } from '@vector-institute/aieng-auth-react'; function MyComponent() { const { isAuthenticated, user, login, logout } = useAuth(); @@ -151,3 +161,72 @@ pnpm install # Install dependencies pnpm build # Build all packages pnpm test # Run tests ``` + +## Publishing + +This project uses [Changesets](https://github.com/changesets/changesets) for version management and publishing, with [npm Trusted Publishers](https://docs.npmjs.com/trusted-publishers) for secure authentication. + +### Setup (One-Time) + +Configure npm Trusted Publishers to allow GitHub Actions to publish without tokens: + +1. **Log in to npm**: Go to [npmjs.com](https://www.npmjs.com) and sign in + +2. **Navigate to Publishing Access**: + - For each package (`@vector-institute/aieng-auth-core` and `@vector-institute/aieng-auth-react`): + - Go to the package page (create if it doesn't exist yet) + - Click "Settings" → "Publishing Access" + - Or go directly to: `https://www.npmjs.com/package/@vector-institute/PACKAGE_NAME/access` + +3. **Add GitHub Actions as Trusted Publisher**: + - Click "Add Trusted Publisher" + - Select "GitHub Actions" + - Fill in: + - **Repository owner**: `VectorInstitute` + - **Repository name**: `aieng-auth` + - **Workflow name**: `publish.yml` + - **Environment name**: (leave empty) + - Click "Add" + +4. **Repeat for all packages**: Do steps 2-3 for both `@vector-institute/aieng-auth-core` and `@vector-institute/aieng-auth-react` + +**Note**: If packages don't exist yet on npm, you can either: + +- Create them manually first (recommended) +- Or publish the first version using a temporary automation token, then configure trusted publishing + +### Release Workflow + +1. **Make your changes** and commit them to a branch + +2. **Create a changeset** describing your changes: + + ```bash + pnpm changeset + ``` + + - Select the packages that changed (core, react, or both) + - Select the version bump type (major, minor, or patch) + - Provide a description of the changes + +3. **Commit the changeset** along with your code changes: + + ```bash + git add .changeset + git commit -m "feat: your feature description" + ``` + +4. **Create a pull request** - the changeset file will be included + +5. **Merge to main** - the publish workflow will: + - Create a "Version Packages" PR that updates versions and changelogs + - When you merge the "Version Packages" PR, packages are automatically published to npm + +### Manual Publishing (if needed) + +```bash +pnpm build # Build all packages +pnpm changeset version # Update versions and changelogs +pnpm changeset publish # Publish to npm +git push --follow-tags # Push version commits and tags +``` diff --git a/apps/demo-nextjs/CHANGELOG.md b/apps/demo-nextjs/CHANGELOG.md new file mode 100644 index 0000000..e6572a1 --- /dev/null +++ b/apps/demo-nextjs/CHANGELOG.md @@ -0,0 +1,8 @@ +# demo-nextjs + +## 0.1.1 + +### Patch Changes + +- Updated dependencies + - @aieng-auth/core@0.1.1 diff --git a/apps/demo-nextjs/package.json b/apps/demo-nextjs/package.json index 915edcc..75a52ec 100644 --- a/apps/demo-nextjs/package.json +++ b/apps/demo-nextjs/package.json @@ -1,6 +1,6 @@ { "name": "demo-nextjs", - "version": "0.1.0", + "version": "0.1.1", "private": true, "scripts": { "dev": "next dev -p 3001", @@ -10,7 +10,7 @@ "type-check": "tsc --noEmit" }, "dependencies": { - "@aieng-auth/core": "workspace:*", + "@vector-institute/aieng-auth-core": "workspace:*", "iron-session": "^8.0.1", "next": "14.1.0", "react": "^18.2.0", diff --git a/apps/demo-nextjs/src/app/api/auth/callback/route.ts b/apps/demo-nextjs/src/app/api/auth/callback/route.ts index 3ff3d1a..9d78686 100644 --- a/apps/demo-nextjs/src/app/api/auth/callback/route.ts +++ b/apps/demo-nextjs/src/app/api/auth/callback/route.ts @@ -1,5 +1,5 @@ import { NextRequest, NextResponse } from 'next/server'; -import { GoogleOAuthClient } from '@aieng-auth/core'; +import { GoogleOAuthClient } from '@vector-institute/aieng-auth-core'; import { authConfig } from '@/lib/auth-config'; import { createSession } from '@/lib/session'; import { cookies } from 'next/headers'; diff --git a/apps/demo-nextjs/src/app/api/auth/login/route.ts b/apps/demo-nextjs/src/app/api/auth/login/route.ts index 17dab78..14feebf 100644 --- a/apps/demo-nextjs/src/app/api/auth/login/route.ts +++ b/apps/demo-nextjs/src/app/api/auth/login/route.ts @@ -1,5 +1,5 @@ import { NextResponse } from 'next/server'; -import { GoogleOAuthClient } from '@aieng-auth/core'; +import { GoogleOAuthClient } from '@vector-institute/aieng-auth-core'; import { authConfig } from '@/lib/auth-config'; export async function GET() { @@ -7,7 +7,7 @@ export async function GET() { const client = new GoogleOAuthClient(authConfig); // Generate PKCE and store in session - const pkce = await import('@aieng-auth/core').then((m) => m.generatePKCE()); + const pkce = await import('@vector-institute/aieng-auth-core').then((m) => m.generatePKCE()); // Build authorization URL const authUrl = new URL('https://accounts.google.com/o/oauth2/v2/auth'); diff --git a/apps/demo-nextjs/src/lib/auth-config.ts b/apps/demo-nextjs/src/lib/auth-config.ts index 6371ac0..c591a91 100644 --- a/apps/demo-nextjs/src/lib/auth-config.ts +++ b/apps/demo-nextjs/src/lib/auth-config.ts @@ -1,4 +1,4 @@ -import type { AuthConfig } from '@aieng-auth/core'; +import type { AuthConfig } from '@vector-institute/aieng-auth-core'; // Allow builds in CI/build environments with placeholder values // Only enforce required environment variables at actual runtime diff --git a/apps/demo-nextjs/src/lib/session.ts b/apps/demo-nextjs/src/lib/session.ts index a43023a..58bfd3f 100644 --- a/apps/demo-nextjs/src/lib/session.ts +++ b/apps/demo-nextjs/src/lib/session.ts @@ -1,6 +1,6 @@ import { getIronSession, IronSession } from 'iron-session'; import { cookies } from 'next/headers'; -import type { AuthTokens, User } from '@aieng-auth/core'; +import type { AuthTokens, User } from '@vector-institute/aieng-auth-core'; export interface SessionData { tokens: AuthTokens | null; diff --git a/apps/demo-react/CHANGELOG.md b/apps/demo-react/CHANGELOG.md new file mode 100644 index 0000000..b232761 --- /dev/null +++ b/apps/demo-react/CHANGELOG.md @@ -0,0 +1,9 @@ +# demo-react + +## 0.1.1 + +### Patch Changes + +- Updated dependencies + - @aieng-auth/core@0.1.1 + - @aieng-auth/react@0.1.1 diff --git a/apps/demo-react/package.json b/apps/demo-react/package.json index 55771a9..f6d8847 100644 --- a/apps/demo-react/package.json +++ b/apps/demo-react/package.json @@ -1,7 +1,7 @@ { "name": "demo-react", "private": true, - "version": "0.1.0", + "version": "0.1.1", "type": "module", "scripts": { "dev": "vite", @@ -10,8 +10,8 @@ "type-check": "tsc --noEmit" }, "dependencies": { - "@aieng-auth/core": "workspace:*", - "@aieng-auth/react": "workspace:*", + "@vector-institute/aieng-auth-core": "workspace:*", + "@vector-institute/aieng-auth-react": "workspace:*", "react": "^18.2.0", "react-dom": "^18.2.0", "react-router-dom": "^6.22.0" diff --git a/apps/demo-react/src/App.tsx b/apps/demo-react/src/App.tsx index fc81932..fc52df2 100644 --- a/apps/demo-react/src/App.tsx +++ b/apps/demo-react/src/App.tsx @@ -1,5 +1,5 @@ import { BrowserRouter, Routes, Route } from 'react-router-dom'; -import { AuthProvider } from '@aieng-auth/react'; +import { AuthProvider } from '@vector-institute/aieng-auth-react'; import HomePage from './pages/home-page'; import DashboardPage from './pages/dashboard-page'; import CallbackPage from './pages/callback-page'; diff --git a/apps/demo-react/src/pages/callback-page.tsx b/apps/demo-react/src/pages/callback-page.tsx index 801e22a..59271db 100644 --- a/apps/demo-react/src/pages/callback-page.tsx +++ b/apps/demo-react/src/pages/callback-page.tsx @@ -1,6 +1,6 @@ import { useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; -import { useAuth } from '@aieng-auth/react'; +import { useAuth } from '@vector-institute/aieng-auth-react'; export default function CallbackPage() { const navigate = useNavigate(); diff --git a/apps/demo-react/src/pages/dashboard-page.tsx b/apps/demo-react/src/pages/dashboard-page.tsx index e40daf7..f93ad9c 100644 --- a/apps/demo-react/src/pages/dashboard-page.tsx +++ b/apps/demo-react/src/pages/dashboard-page.tsx @@ -1,4 +1,4 @@ -import { useAuth } from '@aieng-auth/react'; +import { useAuth } from '@vector-institute/aieng-auth-react'; import { Link, Navigate } from 'react-router-dom'; export default function DashboardPage() { diff --git a/apps/demo-react/src/pages/demo-page.tsx b/apps/demo-react/src/pages/demo-page.tsx index 1629d98..1063961 100644 --- a/apps/demo-react/src/pages/demo-page.tsx +++ b/apps/demo-react/src/pages/demo-page.tsx @@ -10,7 +10,7 @@ import { decodeToken, type PKCEChallenge, type AuthTokens, -} from '@aieng-auth/core'; +} from '@vector-institute/aieng-auth-core'; export default function DemoPage() { const [pkce, setPkce] = useState(null); diff --git a/apps/demo-react/src/pages/home-page.tsx b/apps/demo-react/src/pages/home-page.tsx index f537fbb..f500604 100644 --- a/apps/demo-react/src/pages/home-page.tsx +++ b/apps/demo-react/src/pages/home-page.tsx @@ -1,4 +1,4 @@ -import { useAuth } from '@aieng-auth/react'; +import { useAuth } from '@vector-institute/aieng-auth-react'; import { Link } from 'react-router-dom'; export default function HomePage() { @@ -34,14 +34,14 @@ export default function HomePage() {

Welcome

- Add Google OAuth SSO using @aieng-auth/react + Add Google OAuth SSO using @vector-institute/aieng-auth-react

Quick Start:
  1. - Install: pnpm add @aieng-auth/react + Install: pnpm add @vector-institute/aieng-auth-react
  2. Wrap app with <AuthProvider> diff --git a/package.json b/package.json index 5d711dd..d7c9ede 100644 --- a/package.json +++ b/package.json @@ -13,9 +13,9 @@ ], "repository": { "type": "git", - "url": "https://github.com/your-org/aieng-template-auth.git" + "url": "https://github.com/VectorInstitute/aieng-auth.git" }, - "license": "MIT", + "license": "Apache-2.0", "engines": { "node": ">=18.0.0", "pnpm": ">=8.0.0" diff --git a/packages/core/CHANGELOG.md b/packages/core/CHANGELOG.md new file mode 100644 index 0000000..a851e0f --- /dev/null +++ b/packages/core/CHANGELOG.md @@ -0,0 +1,12 @@ +# @vector-institute/aieng-auth-core + +## 0.1.1 + +### Patch Changes + +- Initial release of @vector-institute/aieng-auth packages + - Google OAuth 2.0 client with PKCE security + - React hooks and components for authentication + - Domain-based access restrictions + - Automatic token refresh + - Framework-agnostic core library diff --git a/packages/core/package.json b/packages/core/package.json index bc4da4c..e43ddba 100644 --- a/packages/core/package.json +++ b/packages/core/package.json @@ -1,6 +1,6 @@ { - "name": "@aieng-auth/core", - "version": "0.1.0", + "name": "@vector-institute/aieng-auth-core", + "version": "0.1.1", "description": "Framework-agnostic Google OAuth authentication core library", "keywords": [ "google", @@ -9,8 +9,8 @@ "pkce", "security" ], - "author": "Your Organization", - "license": "MIT", + "author": "Vector Institute", + "license": "Apache-2.0", "main": "./dist/index.js", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", diff --git a/packages/react/CHANGELOG.md b/packages/react/CHANGELOG.md new file mode 100644 index 0000000..252bf5f --- /dev/null +++ b/packages/react/CHANGELOG.md @@ -0,0 +1,15 @@ +# @vector-institute/aieng-auth-react + +## 0.1.1 + +### Patch Changes + +- Initial release of @vector-institute/aieng-auth packages + - Google OAuth 2.0 client with PKCE security + - React hooks and components for authentication + - Domain-based access restrictions + - Automatic token refresh + - Framework-agnostic core library + +- Updated dependencies + - @vector-institute/aieng-auth-core@0.1.1 diff --git a/packages/react/package.json b/packages/react/package.json index 7b74682..48f714f 100644 --- a/packages/react/package.json +++ b/packages/react/package.json @@ -1,6 +1,6 @@ { - "name": "@aieng-auth/react", - "version": "0.1.0", + "name": "@vector-institute/aieng-auth-react", + "version": "0.1.1", "description": "React hooks and components for Google OAuth authentication", "keywords": [ "google", @@ -9,8 +9,8 @@ "hooks", "authentication" ], - "author": "Your Organization", - "license": "MIT", + "author": "Vector Institute", + "license": "Apache-2.0", "main": "./dist/index.js", "module": "./dist/index.mjs", "types": "./dist/index.d.ts", @@ -38,7 +38,7 @@ "clean": "rm -rf dist .turbo node_modules" }, "dependencies": { - "@aieng-auth/core": "workspace:*" + "@vector-institute/aieng-auth-core": "workspace:*" }, "devDependencies": { "@aieng-auth/eslint-config": "workspace:*", diff --git a/packages/react/src/auth-provider.tsx b/packages/react/src/auth-provider.tsx index 06d0677..2d572ee 100644 --- a/packages/react/src/auth-provider.tsx +++ b/packages/react/src/auth-provider.tsx @@ -6,7 +6,7 @@ import { getTimeUntilExpiration, type AuthTokens, type User, -} from '@aieng-auth/core'; +} from '@vector-institute/aieng-auth-core'; import { AuthContext } from './auth-context'; import type { AuthProviderProps, AuthState } from './types'; diff --git a/packages/react/src/index.ts b/packages/react/src/index.ts index 64be883..b756068 100644 --- a/packages/react/src/index.ts +++ b/packages/react/src/index.ts @@ -11,4 +11,9 @@ export type { AuthState, AuthContextValue, AuthProviderProps } from './types'; export type { ProtectedRouteProps } from './protected-route'; // Re-export core types for convenience -export type { AuthConfig, AuthTokens, User, PKCEChallenge } from '@aieng-auth/core'; +export type { + AuthConfig, + AuthTokens, + User, + PKCEChallenge, +} from '@vector-institute/aieng-auth-core'; diff --git a/packages/react/src/types.ts b/packages/react/src/types.ts index 35022ca..f20e855 100644 --- a/packages/react/src/types.ts +++ b/packages/react/src/types.ts @@ -1,4 +1,4 @@ -import type { AuthConfig, AuthTokens, User } from '@aieng-auth/core'; +import type { AuthConfig, AuthTokens, User } from '@vector-institute/aieng-auth-core'; /** * Authentication state diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2a6eb31..c92eca9 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -23,7 +23,7 @@ importers: apps/demo-nextjs: dependencies: - '@aieng-auth/core': + '@vector-institute/aieng-auth-core': specifier: workspace:* version: link:../../packages/core iron-session: @@ -60,10 +60,10 @@ importers: apps/demo-react: dependencies: - '@aieng-auth/core': + '@vector-institute/aieng-auth-core': specifier: workspace:* version: link:../../packages/core - '@aieng-auth/react': + '@vector-institute/aieng-auth-react': specifier: workspace:* version: link:../../packages/react react: @@ -151,7 +151,7 @@ importers: packages/react: dependencies: - '@aieng-auth/core': + '@vector-institute/aieng-auth-core': specifier: workspace:* version: link:../core devDependencies: