@insforge/nextjs 0.6.8 → 0.6.9
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.
- package/dist/api.d.mts +50 -0
- package/dist/api.d.ts +50 -0
- package/dist/index.d.mts +250 -0
- package/dist/index.d.ts +250 -0
- package/dist/index.js +22 -18
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +22 -18
- package/dist/index.mjs.map +1 -1
- package/dist/middleware.d.mts +20 -0
- package/dist/middleware.d.ts +20 -0
- package/package.json +3 -3
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
+
|
|
3
|
+
interface InsforgeMiddlewareConfig {
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
frontendUrl?: string;
|
|
6
|
+
publicRoutes?: string[];
|
|
7
|
+
afterSignInUrl?: string;
|
|
8
|
+
signInUrl?: string;
|
|
9
|
+
signUpUrl?: string;
|
|
10
|
+
cookieName?: string;
|
|
11
|
+
useBuiltInAuth?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare function InsforgeMiddleware(config: InsforgeMiddlewareConfig): (request: NextRequest) => Promise<NextResponse<unknown>>;
|
|
14
|
+
declare const withAuth: typeof InsforgeMiddleware;
|
|
15
|
+
declare const withInsforgeAuth: typeof InsforgeMiddleware;
|
|
16
|
+
declare function getAuthUserId(headers: Headers): string | null;
|
|
17
|
+
declare const getAuthUser: typeof getAuthUserId;
|
|
18
|
+
declare function getAuthToken(headers: Headers): string | null;
|
|
19
|
+
|
|
20
|
+
export { InsforgeMiddleware, type InsforgeMiddlewareConfig, getAuthToken, getAuthUser, getAuthUserId, withAuth, withInsforgeAuth };
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { NextRequest, NextResponse } from 'next/server';
|
|
2
|
+
|
|
3
|
+
interface InsforgeMiddlewareConfig {
|
|
4
|
+
baseUrl: string;
|
|
5
|
+
frontendUrl?: string;
|
|
6
|
+
publicRoutes?: string[];
|
|
7
|
+
afterSignInUrl?: string;
|
|
8
|
+
signInUrl?: string;
|
|
9
|
+
signUpUrl?: string;
|
|
10
|
+
cookieName?: string;
|
|
11
|
+
useBuiltInAuth?: boolean;
|
|
12
|
+
}
|
|
13
|
+
declare function InsforgeMiddleware(config: InsforgeMiddlewareConfig): (request: NextRequest) => Promise<NextResponse<unknown>>;
|
|
14
|
+
declare const withAuth: typeof InsforgeMiddleware;
|
|
15
|
+
declare const withInsforgeAuth: typeof InsforgeMiddleware;
|
|
16
|
+
declare function getAuthUserId(headers: Headers): string | null;
|
|
17
|
+
declare const getAuthUser: typeof getAuthUserId;
|
|
18
|
+
declare function getAuthToken(headers: Headers): string | null;
|
|
19
|
+
|
|
20
|
+
export { InsforgeMiddleware, type InsforgeMiddlewareConfig, getAuthToken, getAuthUser, getAuthUserId, withAuth, withInsforgeAuth };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@insforge/nextjs",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.9",
|
|
4
4
|
"description": "Pre-built authentication UI components for Next.js with Insforge backend - zero configuration required",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"module": "./dist/index.mjs",
|
|
@@ -56,8 +56,8 @@
|
|
|
56
56
|
},
|
|
57
57
|
"devDependencies": {
|
|
58
58
|
"@types/node": "^20.0.0",
|
|
59
|
-
"@types/react": "^
|
|
60
|
-
"@types/react-dom": "^
|
|
59
|
+
"@types/react": "^19.0.0",
|
|
60
|
+
"@types/react-dom": "^19.0.0",
|
|
61
61
|
"tsup": "^8.0.0",
|
|
62
62
|
"typescript": "^5.3.0"
|
|
63
63
|
}
|