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>
This commit is contained in:
23
server/scripts/plant-diagnostics.js
Normal file
23
server/scripts/plant-diagnostics.js
Normal file
@@ -0,0 +1,23 @@
|
||||
#!/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);
|
||||
});
|
||||
Reference in New Issue
Block a user