@eventuras/fides-auth-next 0.7.0 → 0.7.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1,4 +1,4 @@
1
- import { CookieStore } from '@eventuras/fides-auth/server';
1
+ import type { CookieStore } from '@eventuras/fides-auth/server';
2
2
  /**
3
3
  * Builds a {@link CookieStore} backed by Next.js's request cookie store, for the
4
4
  * framework-agnostic server helpers in `@eventuras/fides-auth/server`.
package/dist/cookies.d.ts CHANGED
@@ -1,4 +1,17 @@
1
- import { CookieOptions } from '@eventuras/fides-auth/cookies';
1
+ /**
2
+ * Cookie helpers for Next.js authentication flows.
3
+ *
4
+ * IMPORTANT: These functions can ONLY be used in:
5
+ * - Server Actions (functions marked with 'use server')
6
+ * - Route Handlers (files in app/api directory)
7
+ * - Server Components (async React components)
8
+ *
9
+ * They CANNOT be used in:
10
+ * - Client Components (marked with 'use client')
11
+ * - Middleware (use NextResponse.cookies instead)
12
+ * - Edge Runtime without proper configuration
13
+ */
14
+ import type { CookieOptions } from '@eventuras/fides-auth/cookies';
2
15
  export { COOKIE_INFO_BYTES, COOKIE_MAX_BYTES, CookieTooLargeError, ACCESS_TOKEN_COOKIE_NAME, ID_TOKEN_COOKIE_NAME, defaultSessionCookieOptions, defaultOAuthCookieOptions, cookieByteSize, assertCookieWithinLimit, } from '@eventuras/fides-auth/cookies';
3
16
  export type { CookieOptions } from '@eventuras/fides-auth/cookies';
4
17
  /**
@@ -1,4 +1,13 @@
1
- import { OAuthConfig } from '@eventuras/fides-auth/oauth';
1
+ /**
2
+ * Server-side heartbeat handler for Next.js route handlers — a thin wrapper over
3
+ * the framework-agnostic handler in `@eventuras/fides-auth/server`, wiring it to
4
+ * the Next cookie store and the global POST rate limiter.
5
+ *
6
+ * Pairs with the client-side `useHeartbeat` hook: when the user is active, the
7
+ * client POSTs here, and this handler exchanges the current refresh token for a
8
+ * fresh access token (and rotated refresh token, if the IdP rotates).
9
+ */
10
+ import type { OAuthConfig } from '@eventuras/fides-auth/oauth';
2
11
  export interface HeartbeatHandlerConfig {
3
12
  /** OAuth/OIDC configuration used to refresh the access token. */
4
13
  oauthConfig: OAuthConfig;
@@ -1,4 +1,9 @@
1
- import { OAuthConfig } from '@eventuras/fides-auth/oauth';
1
+ /**
2
+ * OIDC callback handler for Next.js route handlers — a thin wrapper over the
3
+ * framework-agnostic handler in `@eventuras/fides-auth/server`, wiring it to the
4
+ * Next cookie store and the global GET rate limiter.
5
+ */
6
+ import type { OAuthConfig } from '@eventuras/fides-auth/oauth';
2
7
  export interface OidcCallbackConfig {
3
8
  /** OAuth/OIDC configuration (issuer, clientId, clientSecret, redirect_uri, scope) */
4
9
  oauthConfig: OAuthConfig;
@@ -1,4 +1,9 @@
1
- import { OAuthConfig } from '@eventuras/fides-auth/oauth';
1
+ /**
2
+ * OIDC login initiation for Next.js route handlers — a thin wrapper over the
3
+ * framework-agnostic handler in `@eventuras/fides-auth/server`, wiring it to the
4
+ * Next cookie store and the global GET rate limiter.
5
+ */
6
+ import type { OAuthConfig } from '@eventuras/fides-auth/oauth';
2
7
  export interface OidcLoginConfig {
3
8
  /** OAuth/OIDC configuration */
4
9
  oauthConfig: OAuthConfig;
@@ -1,4 +1,9 @@
1
- import { OAuthConfig } from '@eventuras/fides-auth/oauth';
1
+ /**
2
+ * RP-initiated logout for Next.js route handlers — a thin wrapper over the
3
+ * framework-agnostic handler in `@eventuras/fides-auth/server`, wiring it to the
4
+ * Next cookie store and the global POST rate limiter.
5
+ */
6
+ import type { OAuthConfig } from '@eventuras/fides-auth/oauth';
2
7
  export interface OidcLogoutConfig {
3
8
  /** OAuth/OIDC configuration */
4
9
  oauthConfig: OAuthConfig;
package/dist/session.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { ClearSessionOptions, ReadSessionResult, RefreshSessionResult } from '@eventuras/fides-auth/server';
2
- import { Session, CreateSessionOptions } from '@eventuras/fides-auth/types';
3
- import { OAuthConfig } from '@eventuras/fides-auth/oauth';
1
+ import { type ClearSessionOptions, type ReadSessionResult, type RefreshSessionResult } from '@eventuras/fides-auth/server';
2
+ import type { Session, CreateSessionOptions } from '@eventuras/fides-auth/types';
3
+ import type { OAuthConfig } from '@eventuras/fides-auth/oauth';
4
4
  export type { ClearSessionOptions, ReadSessionResult, RefreshSessionResult };
5
5
  /**
6
6
  * Creates an encrypted JWT containing session data.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@eventuras/fides-auth-next",
3
- "version": "0.7.0",
3
+ "version": "0.7.2",
4
4
  "description": "Next.js bindings for @eventuras/fides-auth",
5
5
  "homepage": "https://github.com/losol/fides-auth/tree/main/packages/fides-auth-next#readme",
6
6
  "bugs": {
@@ -58,27 +58,27 @@
58
58
  "LICENSE"
59
59
  ],
60
60
  "dependencies": {
61
- "@eventuras/fides-auth": "0.13.0",
62
- "@eventuras/fides-auth-store": "0.2.1",
63
- "@eventuras/fides-auth-react": "0.1.5"
61
+ "@eventuras/fides-auth-store": "0.2.3",
62
+ "@eventuras/fides-auth": "0.14.1",
63
+ "@eventuras/fides-auth-react": "0.1.7"
64
64
  },
65
65
  "devDependencies": {
66
- "@testing-library/jest-dom": "6.9.1",
66
+ "@testing-library/jest-dom": "7.0.1",
67
67
  "@types/react": "^19.2.18",
68
- "jsdom": "29.1.1",
68
+ "jsdom": "30.0.1",
69
69
  "react": "^19.2.8",
70
- "typescript": "^6.0.2",
71
- "vite": "^8.2.0",
70
+ "typescript": "^7.0.2",
71
+ "vite": "^8.2.1",
72
72
  "vitest": "^4.1.10",
73
73
  "@eventuras/typescript-config": "1.0.0",
74
- "@eventuras/vite-config": "0.2.2"
74
+ "@eventuras/vite-config": "0.3.0"
75
75
  },
76
76
  "peerDependencies": {
77
77
  "next": "^16.0.0",
78
78
  "react": "^19.0.0"
79
79
  },
80
80
  "scripts": {
81
- "build": "vite build",
81
+ "build": "vite build && tsc --emitDeclarationOnly",
82
82
  "typecheck": "tsc --noEmit",
83
83
  "dev": "vite build --watch",
84
84
  "test": "vitest run",