Files
Greenlens/server/scripts/plant-diagnostics.js
Timo Knuth 98e5bfbafd fix: add auth endpoints to server, fix auth bypass and registration
- server/: commit server code for the first time (was untracked)
  - POST /auth/signup and /auth/login endpoints now deployed
  - GET /v1/billing/summary now verifies user exists in auth_users
    (prevents stale JWTs from bypassing auth → fixes empty dashboard)
- app/_layout.tsx: dual-marker install check (SQLite + SecureStore)
  to detect fresh installs reliably on Android
- app/auth/login.tsx, signup.tsx: replace Ionicons leaf logo with
  actual app icon image (assets/icon.png)
- services/authService.ts: log HTTP status + server message on auth errors

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-02 11:08:32 +01:00

24 lines
680 B
JavaScript

#!/usr/bin/env node
/* eslint-disable no-console */
require('dotenv').config();
const { closeDatabase, openDatabase } = require('../lib/sqlite');
const { ensurePlantSchema, getPlantDiagnostics } = require('../lib/plants');
const main = async () => {
const db = await openDatabase();
try {
await ensurePlantSchema(db);
const diagnostics = await getPlantDiagnostics(db);
console.log(JSON.stringify(diagnostics, null, 2));
} finally {
await closeDatabase(db);
}
};
main().catch((error) => {
console.error('Failed to read plant diagnostics.');
console.error(error instanceof Error ? error.stack || error.message : String(error));
process.exit(1);
});