@aion0/forge 0.1.3 → 0.1.4

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/lib/auth.ts CHANGED
@@ -1,6 +1,12 @@
1
1
  import NextAuth from 'next-auth';
2
2
  import Google from 'next-auth/providers/google';
3
3
  import Credentials from 'next-auth/providers/credentials';
4
+ import { randomBytes } from 'node:crypto';
5
+
6
+ // Ensure AUTH_SECRET exists before NextAuth initializes
7
+ if (!process.env.AUTH_SECRET) {
8
+ process.env.AUTH_SECRET = randomBytes(32).toString('hex');
9
+ }
4
10
 
5
11
  export const { handlers, signIn, signOut, auth } = NextAuth({
6
12
  trustHost: true,
package/lib/init.ts CHANGED
@@ -19,12 +19,6 @@ export function ensureInitialized() {
19
19
  if (gInit[initKey]) return;
20
20
  gInit[initKey] = true;
21
21
 
22
- // Ensure AUTH_SECRET is set (NextAuth requires it)
23
- if (!process.env.AUTH_SECRET) {
24
- const { randomBytes } = require('node:crypto');
25
- process.env.AUTH_SECRET = randomBytes(32).toString('hex');
26
- }
27
-
28
22
  // Display login password (auto-generated, rotates daily)
29
23
  const password = getPassword();
30
24
  console.log(`[init] Login password: ${password} (valid today)`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aion0/forge",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Unified AI workflow platform — multi-model task orchestration, persistent sessions, web terminal, remote access",
5
5
  "type": "module",
6
6
  "scripts": {