hazo_auth 5.1.7 → 5.1.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.
@@ -23,11 +23,12 @@ const REQUIRED_DIRECTORIES = [
23
23
  "public/profile_pictures/library",
24
24
  "public/profile_pictures/uploads",
25
25
  "data",
26
+ "config",
26
27
  ];
27
28
 
28
29
  const CONFIG_FILES = [
29
- { source: "hazo_auth_config.example.ini", target: "hazo_auth_config.ini" },
30
- { source: "hazo_notify_config.example.ini", target: "hazo_notify_config.ini" },
30
+ { source: "config/hazo_auth_config.example.ini", target: "config/hazo_auth_config.ini" },
31
+ { source: "config/hazo_notify_config.example.ini", target: "config/hazo_notify_config.ini" },
31
32
  ];
32
33
 
33
34
  // section: helpers
@@ -246,7 +247,7 @@ export function handle_init(): void {
246
247
 
247
248
  console.log("\n\x1b[32m🦊 Initialization complete!\x1b[0m");
248
249
  console.log("\nNext steps:");
249
- console.log(" 1. Edit \x1b[36mhazo_auth_config.ini\x1b[0m with your settings");
250
+ console.log(" 1. Edit \x1b[36mconfig/hazo_auth_config.ini\x1b[0m with your settings");
250
251
  console.log(" 2. Copy \x1b[36m.env.local.example\x1b[0m to \x1b[36m.env.local\x1b[0m and add your API keys");
251
252
  console.log(" 3. Run \x1b[36mnpx hazo_auth generate-routes --pages\x1b[0m to generate routes and pages");
252
253
  console.log(" 4. Run \x1b[36mnpx hazo_auth validate\x1b[0m to check your setup");
@@ -22,8 +22,8 @@ export type ValidationSummary = {
22
22
 
23
23
  // section: constants
24
24
  const REQUIRED_CONFIG_FILES = [
25
- "hazo_auth_config.ini",
26
- "hazo_notify_config.ini",
25
+ "config/hazo_auth_config.ini",
26
+ "config/hazo_notify_config.ini",
27
27
  ];
28
28
 
29
29
  const REQUIRED_ENV_VARS = [
@@ -141,7 +141,7 @@ function check_config_files(project_root: string): CheckResult[] {
141
141
  results.push({
142
142
  name: `Config file: ${config_file}`,
143
143
  status: exists ? "pass" : "fail",
144
- message: exists ? "" : `File not found. Run: cp node_modules/hazo_auth/${config_file.replace(".ini", ".example.ini")} ./${config_file}`,
144
+ message: exists ? "" : `File not found. Run: npx hazo_auth init`,
145
145
  });
146
146
  }
147
147
 
@@ -150,8 +150,8 @@ function check_config_files(project_root: string): CheckResult[] {
150
150
 
151
151
  function check_config_values(project_root: string): CheckResult[] {
152
152
  const results: CheckResult[] = [];
153
-
154
- const hazo_config_path = path.join(project_root, "hazo_auth_config.ini");
153
+
154
+ const hazo_config_path = path.join(project_root, "config", "hazo_auth_config.ini");
155
155
  const hazo_config = read_ini_file(hazo_config_path);
156
156
 
157
157
  if (hazo_config) {
@@ -224,7 +224,7 @@ function check_config_values(project_root: string): CheckResult[] {
224
224
  }
225
225
  }
226
226
 
227
- const notify_config_path = path.join(project_root, "hazo_notify_config.ini");
227
+ const notify_config_path = path.join(project_root, "config", "hazo_notify_config.ini");
228
228
  const notify_config = read_ini_file(notify_config_path);
229
229
 
230
230
  if (notify_config) {
@@ -414,15 +414,15 @@ function check_profile_pictures(project_root: string): CheckResult[] {
414
414
 
415
415
  function check_database(project_root: string): CheckResult[] {
416
416
  const results: CheckResult[] = [];
417
-
418
- const hazo_config_path = path.join(project_root, "hazo_auth_config.ini");
417
+
418
+ const hazo_config_path = path.join(project_root, "config", "hazo_auth_config.ini");
419
419
  const hazo_config = read_ini_file(hazo_config_path);
420
420
 
421
421
  if (!hazo_config) {
422
422
  results.push({
423
423
  name: "Database check",
424
424
  status: "fail",
425
- message: "Could not read hazo_auth_config.ini",
425
+ message: "Could not read config/hazo_auth_config.ini",
426
426
  });
427
427
  return results;
428
428
  }
@@ -6,7 +6,7 @@ import fs from "fs";
6
6
  import { create_app_logger } from "../app_logger.js";
7
7
 
8
8
  // section: constants
9
- const DEFAULT_CONFIG_FILE = "hazo_auth_config.ini";
9
+ const DEFAULT_CONFIG_FILE = "config/hazo_auth_config.ini";
10
10
 
11
11
  // section: helpers
12
12
  /**
@@ -261,7 +261,7 @@ export async function accept_invitation(
261
261
  if (invitation.status !== "PENDING") {
262
262
  return {
263
263
  success: false,
264
- error: `Invitation is ${invitation.status.toLowerCase()}, not pending`,
264
+ error: `Invitation is ${invitation.status}, not PENDING`,
265
265
  };
266
266
  }
267
267
 
@@ -361,7 +361,7 @@ export async function revoke_invitation(
361
361
  if (invitation_result.invitation.status !== "PENDING") {
362
362
  return {
363
363
  success: false,
364
- error: `Cannot revoke invitation with status ${invitation_result.invitation.status.toLowerCase()}`,
364
+ error: `Cannot revoke invitation with status ${invitation_result.invitation.status}`,
365
365
  };
366
366
  }
367
367