@aura-stack/next 0.3.0 → 0.3.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 +1 @@
1
- import{AuthProvider as e}from"./context.js";import{createAuth as t}from"@aura-stack/react/server";const n=e=>`${e.headers[`x-forwarded-proto`]??`http`}://${e.headers[`x-forwarded-host`]??e.headers.host}`,r=(e,t)=>{for(let[n,r]of t.entries())n.toLowerCase()===`set-cookie`?e.setHeader(`Set-Cookie`,t.getSetCookie()):e.setHeader(n,r)},i=e=>async(t,i)=>{let a=t.method??`GET`,o=e[a];if(!o)return i.status(405).json({error:`Method ${a} Not Allowed`});let s=new URL(t.url,n(t)),c=new Request(s,{method:a,headers:new Headers(t.headers),body:a!==`GET`&&a!==`HEAD`?t.body:void 0});try{let e=await o(c);e.status>=300&&e.status<400&&!t.url?.includes(`/auth/signIn/`)&&!t.url?.includes(`/auth/callback/`)&&e.headers.delete(`Location`),r(i,e.headers);let n=await e.json();return i.status(e.status).json(n)}catch{return i.status(500).json({error:`Internal Server Error`})}},a=e=>{let n=t(e);return{...n,toHandler:i(n.handlers)}};export{e as AuthProvider,a as createAuth};
1
+ import{AuthProvider as e}from"./context.js";import{createAuth as t}from"@aura-stack/react/server";const n=e=>`${e.headers[`x-forwarded-proto`]??`http`}://${e.headers[`x-forwarded-host`]??e.headers.host}`,r=(e,t)=>{for(let[n,r]of t.entries())n.toLowerCase()===`set-cookie`?e.setHeader(`Set-Cookie`,t.getSetCookie()):e.setHeader(n,r)},i=({handlers:e})=>async(t,i)=>{let a=t.method??`GET`,o=e[a];if(!o)return i.status(405).json({error:`Method ${a} Not Allowed`});let s=new URL(t.url,n(t)),c=new Request(s,{method:a,headers:new Headers(t.headers),body:a!==`GET`&&a!==`HEAD`?t.body:void 0});try{let e=await o(c);e.status>=300&&e.status<400&&!t.url?.includes(`/auth/signIn/`)&&!t.url?.includes(`/auth/callback/`)&&e.headers.delete(`Location`),r(i,e.headers);let n=await e.json();return i.status(e.status).json(n)}catch{return i.status(500).json({error:`Internal Server Error`})}},a=e=>{let n=t(e);return{...n,toHandler:i(n)}};export{e as AuthProvider,a as createAuth};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aura-stack/next",
3
- "version": "0.3.0",
3
+ "version": "0.3.2",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "Authentication integration for Next.js applications. Supports App Router, Server Components, Route Handlers and client-side authentication powered by Aura Auth.",
@@ -52,7 +52,7 @@
52
52
  "aura stack ts"
53
53
  ],
54
54
  "dependencies": {
55
- "@aura-stack/react": "0.3.0"
55
+ "@aura-stack/react": "0.3.2"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@testing-library/dom": "^10.4.1",
@@ -63,8 +63,9 @@
63
63
  "node-mocks-http": "^1.17.2",
64
64
  "react": "^19.2.3",
65
65
  "react-dom": "^19.2.3",
66
- "@aura-stack/tsdown-config": "0.0.0",
67
- "@aura-stack/tsconfig": "0.0.0"
66
+ "vitest": "4.1.4",
67
+ "@aura-stack/tsconfig": "0.0.0",
68
+ "@aura-stack/tsdown-config": "0.0.0"
68
69
  },
69
70
  "peerDependencies": {
70
71
  "next": ">=16.0.0",
@@ -149,8 +150,9 @@
149
150
  "test": "vitest --run",
150
151
  "test:watch": "vitest",
151
152
  "test:coverage": "vitest --run --coverage",
153
+ "test:types": "vitest --run --typecheck.only",
152
154
  "type-check": "tsc --noEmit",
153
- "clean": "rm -rf dist src/_core src/oauth",
155
+ "clean": "rm -rf dist src/_core src/oauth src/identity",
154
156
  "clean:cts": "[ -d dist ] && find dist -type f -name \"*.cts\" -delete || true",
155
157
  "sync:modules": "node ../shared/scripts/modules.js --from react"
156
158
  }
@@ -1,3 +0,0 @@
1
- import * as import__aura_stack_react_types from "@aura-stack/react/types";
2
- //#endregion
3
- export { __exportAll as n, __reExport as r, core_d_exports as t };