When the token expiry is set to 'never', the API returns 0 for the
expire property. After deserialization, this property was being
populated with the Unix epoch time. To fix this, added an additional
check and updated the label to align with our web UI.

Signed-off-by: Shan Shaji <[email protected]>
---
 lib/pages/main_layout_slim.dart | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/lib/pages/main_layout_slim.dart b/lib/pages/main_layout_slim.dart
index 0aca666..4229ef4 100644
--- a/lib/pages/main_layout_slim.dart
+++ b/lib/pages/main_layout_slim.dart
@@ -940,8 +940,9 @@ class MobileAccessManagement extends StatelessWidget {
                     itemCount: aState.tokens.length,
                     itemBuilder: (context, index) {
                       final token = aState.tokens[index];
-                      var expireDate = 'infinite';
-                      if (token.expire != null) {
+                      var expireDate = 'never';
+                      if (token.expire != null &&
+                          token.expire?.millisecondsSinceEpoch != 0) {
                         expireDate = DateFormat.yMd().format(token.expire!);
                       }
 
-- 
2.47.3



_______________________________________________
pve-devel mailing list
[email protected]
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel

Reply via email to