feat: add a book by scanning

This commit is contained in:
Alzalia 2025-08-09 01:42:22 +02:00
parent 72fd0b66a9
commit 981dce5bfe
14 changed files with 264 additions and 59 deletions

View file

@ -20,7 +20,6 @@ class AuthClient {
try {
await _initStore();
bool hasToken = await _secureStorage!.containsKey(key: "token");
debugPrint("\n\n\n${hasToken == true} => HAS_TOKEN\n\n\n");
if (hasToken) {
var token = await _secureStorage!.read(key: "token");
var url = Uri.parse("https://$apiBasePath/token-check");
@ -29,9 +28,6 @@ class AuthClient {
headers: {"Content-Type": "application/json"},
body: jsonEncode({"token": token}),
);
debugPrint(
"\n\n\n${response.body is String} => ${response.body}\n\n\n",
);
if (response.body == "true") {
return Result.ok(true);
@ -39,7 +35,6 @@ class AuthClient {
}
return Result.ok(false);
} catch (e) {
debugPrint(e.toString());
return Result.error(Exception(e));
}
}
@ -67,8 +62,6 @@ class AuthClient {
return Result.error(Exception("Token creation error"));
}
} catch (e, stackTrace) {
debugPrint(e.toString());
debugPrintStack(stackTrace: stackTrace);
return Result.error(Exception(e));
} finally {
client.close();