From 1aa301d75b600dd06c5598ae8fe9eedb09d4565d Mon Sep 17 00:00:00 2001 From: olorin99 Date: Wed, 3 Jun 2026 09:14:32 +1000 Subject: [PATCH] Fix password length condition to allow for passwords shorter than the max length. --- lib/src/controller/controller.dart | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/src/controller/controller.dart b/lib/src/controller/controller.dart index a3fb1527..8defa1e1 100644 --- a/lib/src/controller/controller.dart +++ b/lib/src/controller/controller.dart @@ -1,5 +1,6 @@ import 'dart:convert'; import 'dart:io'; +import 'dart:math'; import 'package:auto_route/auto_route.dart'; import 'package:drift/drift.dart'; @@ -475,7 +476,7 @@ class AppController with ChangeNotifier { }: username, 'password': password?.substring( 0, - software == ServerSoftware.lemmy ? 60 : 128, + min(password.length, software == ServerSoftware.lemmy ? 60 : 128), ), if (software == ServerSoftware.lemmy) 'totp_2fa_token': totp, }),