@flame0510/project-aether 1.1.9 → 1.1.10

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.
@@ -70,11 +70,17 @@ export async function POST(request: NextRequest): Promise<NextResponse> {
70
70
  .setExpirationTime('7d')
71
71
  .sign(secretKey);
72
72
 
73
+ // Use secure cookies only when running behind HTTPS.
74
+ // On plain HTTP the Secure flag prevents the browser from sending
75
+ // the cookie, causing an immediate redirect loop after login.
76
+ const isProduction = process.env.NODE_ENV === 'production';
77
+ const forceInsecure = process.env.REV4A_FORCE_INSECURE_COOKIE === '1';
78
+
73
79
  const response = NextResponse.json({ ok: true });
74
80
  response.cookies.set('rev4a_token', token, {
75
81
  httpOnly: true,
76
- secure: true,
77
- sameSite: 'strict',
82
+ secure: isProduction && !forceInsecure,
83
+ sameSite: isProduction && !forceInsecure ? 'strict' : 'lax',
78
84
  maxAge: 60 * 60 * 24 * 7,
79
85
  path: '/',
80
86
  });
@@ -21,10 +21,13 @@ export function POST(): NextResponse {
21
21
 
22
22
  const response = NextResponse.json({ done: true });
23
23
  // Also set cookie for backwards compat / existing clients
24
+ const isProduction = process.env.NODE_ENV === 'production';
25
+ const forceInsecure = process.env.REV4A_FORCE_INSECURE_COOKIE === '1';
26
+
24
27
  response.cookies.set('wizard_done', '1', {
25
28
  httpOnly: true,
26
- sameSite: 'lax',
27
- secure: process.env.NODE_ENV === 'production',
29
+ sameSite: isProduction && !forceInsecure ? 'strict' : 'lax',
30
+ secure: isProduction && !forceInsecure,
28
31
  maxAge: 60 * 60 * 24 * 365,
29
32
  path: '/',
30
33
  });
@@ -17,10 +17,13 @@ export function POST(): NextResponse {
17
17
  try { fs.unlinkSync(WIZARD_FILE); } catch { /* ignore */ }
18
18
 
19
19
  const response = NextResponse.json({ done: false });
20
+ const isProduction = process.env.NODE_ENV === 'production';
21
+ const forceInsecure = process.env.REV4A_FORCE_INSECURE_COOKIE === '1';
22
+
20
23
  response.cookies.set('wizard_done', '', {
21
24
  httpOnly: true,
22
- secure: process.env.NODE_ENV === 'production',
23
- sameSite: 'lax',
25
+ secure: isProduction && !forceInsecure,
26
+ sameSite: isProduction && !forceInsecure ? 'strict' : 'lax',
24
27
  maxAge: 0,
25
28
  path: '/',
26
29
  });
package/bin/rev4a.js CHANGED
@@ -413,7 +413,7 @@ function serve(port) {
413
413
  ...process.env,
414
414
  ...envVars,
415
415
  PORT: String(port),
416
- NODE_ENV: 'production',
416
+ NODE_ENV: process.env.NODE_ENV || 'production',
417
417
  };
418
418
 
419
419
  const children = [];
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@flame0510/project-aether",
3
- "version": "1.1.9",
4
- "description": "Rev4a \u2014 Revolution for Agents. OpenClaw agent fleet orchestrator.",
3
+ "version": "1.1.10",
4
+ "description": "Rev4a — Revolution for Agents. OpenClaw agent fleet orchestrator.",
5
5
  "keywords": [
6
6
  "openclaw",
7
7
  "rev4a",