fluxy-bot 0.7.0 → 0.7.1

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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/worker/index.ts +5 -1
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fluxy-bot",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
4
4
  "releaseNotes": [
5
5
  "Fixed some bugs to iOs ",
6
6
  "2. ",
package/worker/index.ts CHANGED
@@ -423,7 +423,7 @@ app.get('/api/portal/totp/status', (_req, res) => {
423
423
  });
424
424
 
425
425
  app.post('/api/portal/totp/setup', async (req, res) => {
426
- // Verify caller has auth: either valid session token or correct password
426
+ // Verify caller has auth: session token, correct password, or initial onboard (no password set yet)
427
427
  const authHeader = req.headers['authorization'];
428
428
  let authorized = false;
429
429
  if (authHeader?.startsWith('Bearer ')) {
@@ -434,6 +434,8 @@ app.post('/api/portal/totp/setup', async (req, res) => {
434
434
  const storedPass = getSetting('portal_pass');
435
435
  if (storedPass && verifyPassword(req.body.password, storedPass)) authorized = true;
436
436
  }
437
+ // During initial onboard, no password is stored yet — allow setup
438
+ if (!authorized && !getSetting('portal_pass')) authorized = true;
437
439
  if (!authorized) { res.status(401).json({ error: 'Unauthorized' }); return; }
438
440
 
439
441
  const secret = generateTOTPSecret();
@@ -462,6 +464,8 @@ app.post('/api/portal/totp/verify-setup', (req, res) => {
462
464
  const storedPass = getSetting('portal_pass');
463
465
  if (storedPass && verifyPassword(req.body.password, storedPass)) authorized = true;
464
466
  }
467
+ // During initial onboard, no password is stored yet — allow verify
468
+ if (!authorized && !getSetting('portal_pass')) authorized = true;
465
469
  if (!authorized) { res.status(401).json({ error: 'Unauthorized' }); return; }
466
470
 
467
471
  const { code } = req.body;