natureco-cli 5.51.3 → 5.51.5

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/CHANGELOG.md CHANGED
@@ -2,6 +2,11 @@
2
2
 
3
3
  All notable changes to NatureCo CLI will be documented in this file.
4
4
 
5
+ ## [5.51.4] - 2026-07-11 — "account: OTP kodu magiclink tipini de dener"
6
+
7
+ ### Fixed
8
+ - **6/8 haneli kodla giriş** (`{{ .Token }}` şablona eklenmişse) çalışır: kod doğrulaması `type:email` başarısızsa `type:magiclink` ile tekrar denenir; boşluklar temizlenir. (Kod tek kullanımlık — her `account login` yeni kod üretir, EN SON e-postadaki kodu kullan.)
9
+
5
10
  ## [5.51.3] - 2026-07-11 — "account: implicit magic link (fragment access_token)"
6
11
 
7
12
  ### Fixed
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "natureco-cli",
3
- "version": "5.51.3",
3
+ "version": "5.51.5",
4
4
  "description": "OpenClaw'dan daha güvenli, daha hızlı, daha ucuz AI agent CLI. Multi-agent, self-evolving skills, audit log, maliyet optimizasyonu ve NatureCo platform-native.",
5
5
  "bin": {
6
6
  "natureco": "bin/natureco.js"
@@ -31,6 +31,7 @@ function help() {
31
31
  rows: [
32
32
  { name: 'natureco setup', desc: 'İlk kurulum sihirbazı (provider, bot)' },
33
33
  { name: 'natureco login', desc: 'API key ile giriş yap' },
34
+ { name: 'natureco account', desc: 'NatureCo hesabı / SSO (login|logout|whoami)' },
34
35
  { name: 'natureco logout', desc: 'Çıkış yap' },
35
36
  { name: 'natureco update', desc: 'Yeni versiyon kontrolü' },
36
37
  { name: 'natureco doctor', desc: 'Sistem sağlığı kontrolü (10 check)' },
@@ -70,9 +70,21 @@ async function sendOtp(email) {
70
70
  return { sent: true, email };
71
71
  }
72
72
 
73
- /** OTP kodunu doğrula → oturum */
73
+ /**
74
+ * OTP kodunu doğrula → oturum. Supabase'de e-postayla gelen kodun doğrulama tipi
75
+ * şablona göre 'email' ya da 'magiclink' olabilir → ikisini de dener.
76
+ */
74
77
  async function verifyOtp(email, token) {
75
- return saveSession(_shape(await _post('/verify', { type: 'email', email, token })));
78
+ const code = String(token).replace(/\s+/g, '');
79
+ try {
80
+ return saveSession(_shape(await _post('/verify', { type: 'email', email, token: code })));
81
+ } catch (e1) {
82
+ try {
83
+ return saveSession(_shape(await _post('/verify', { type: 'magiclink', email, token: code })));
84
+ } catch (_) {
85
+ throw e1;
86
+ }
87
+ }
76
88
  }
77
89
 
78
90
  // JWT access_token içinden kullanıcıyı çöz (imza doğrulaması yok — sadece görüntüleme)