From b4cbfa08f5701013a7bfd6b7abf52a737dc699e9 Mon Sep 17 00:00:00 2001 From: Johan Jongsma Date: Sun, 1 Feb 2026 21:11:56 +0000 Subject: [PATCH] Fix API endpoints to match inou backend - /api/v1/auth/send (not /api/auth/send-code) - /api/v1/auth/verify (not /api/auth/verify) - Check for token in response (not success: true) --- lib/services/inou_api.dart | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/services/inou_api.dart b/lib/services/inou_api.dart index e3f66e8..50f0011 100644 --- a/lib/services/inou_api.dart +++ b/lib/services/inou_api.dart @@ -44,7 +44,7 @@ class InouApi { Future sendLoginCode(String email) async { try { final response = await http.post( - Uri.parse('$baseUrl/api/auth/send-code'), + Uri.parse('$baseUrl/api/v1/auth/send'), headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', @@ -80,7 +80,7 @@ class InouApi { Future verifyCode(String email, String code) async { try { final response = await http.post( - Uri.parse('$baseUrl/api/auth/verify'), + Uri.parse('$baseUrl/api/v1/auth/verify'), headers: { 'Content-Type': 'application/json', 'Accept': 'application/json', @@ -101,13 +101,11 @@ class InouApi { final json = jsonDecode(response.body); - if (response.statusCode == 200 && json['success'] == true) { - // Get session token from response - _sessionToken = json['token'] ?? json['session_token']; + if (response.statusCode == 200 && json['token'] != null) { + // Success - got session token + _sessionToken = json['token']; _dossierId = json['dossier_id']; - if (_sessionToken != null) { - await _saveSession(); - } + await _saveSession(); return null; // Success }