Skip to content
This repository was archived by the owner on Nov 19, 2025. It is now read-only.

Commit e517027

Browse files
committed
bug fixes
1 parent 9d8ab30 commit e517027

7 files changed

Lines changed: 33 additions & 5 deletions

File tree

assets/lang/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
"verification.success": "Email has been successfully verified!",
193193
"verification.resend_success": "New verification code has been sent.",
194194
"verification.resend_error": "An error occurred while sending code. Please try again.",
195-
"main.app_title": "ServApp",
195+
"main.app_title": "Skysync",
196196
"main.welcome_back": "Welcome back, {username}!",
197197
"main.manage_files": "Manage your files and folders",
198198
"main.quick_actions": "Quick actions",

assets/lang/pl.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,7 @@
192192
"verification.success": "E-mail został pomyślnie zweryfikowany!",
193193
"verification.resend_success": "Nowy kod weryfikacyjny został wysłany.",
194194
"verification.resend_error": "Wystąpił błąd podczas wysyłania kodu. Spróbuj ponownie.",
195-
"main.app_title": "ServApp",
195+
"main.app_title": "Skysync",
196196
"main.welcome_back": "Witaj ponownie, {username}!",
197197
"main.manage_files": "Zarządzaj swoimi plikami i folderami",
198198
"main.quick_actions": "Szybkie akcje",

lib/main.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ class _MyAppState extends State<MyApp> {
7373
animation: _appSettings,
7474
builder: (context, child) {
7575
return MaterialApp(
76-
title: 'kysync',
76+
title: 'Skysync',
7777
debugShowCheckedModeBanner: false,
7878
showSemanticsDebugger: false,
7979
navigatorKey: NotificationService.navigatorKey,

lib/utils/token_service.dart

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import 'package:shared_preferences/shared_preferences.dart';
2+
import 'package:jwt_decoder/jwt_decoder.dart';
23

34
class TokenService {
45
static const String _tokenKey = 'access_token';
@@ -54,7 +55,25 @@ class TokenService {
5455
final token = await getToken();
5556
final username = await getUsername();
5657
final email = await getEmail();
57-
return token != null && username != null && email != null;
58+
59+
if (token == null || username == null || email == null) {
60+
return false;
61+
}
62+
63+
try {
64+
final decodedToken = JwtDecoder.decode(token);
65+
final expiryDate = DateTime.fromMillisecondsSinceEpoch(decodedToken['exp'] * 1000);
66+
67+
if (expiryDate.isBefore(DateTime.now())) {
68+
await logout();
69+
return false;
70+
}
71+
72+
return true;
73+
} catch (e) {
74+
await logout();
75+
return false;
76+
}
5877
}
5978

6079
static Future<void> logout() async {

pubspec.lock

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -309,6 +309,14 @@ packages:
309309
url: "https://pub.dev"
310310
source: hosted
311311
version: "4.9.0"
312+
jwt_decoder:
313+
dependency: "direct main"
314+
description:
315+
name: jwt_decoder
316+
sha256: "54774aebf83f2923b99e6416b4ea915d47af3bde56884eb622de85feabbc559f"
317+
url: "https://pub.dev"
318+
source: hosted
319+
version: "2.0.1"
312320
leak_tracker:
313321
dependency: transitive
314322
description:

pubspec.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ dependencies:
5050
open_file: ^3.3.2
5151
syncfusion_flutter_pdfviewer: ^30.1.42
5252
crypto: ^3.0.3
53+
jwt_decoder: ^2.0.1
5354

5455
dev_dependencies:
5556
flutter_test:

windows/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ project(fileserver LANGUAGES CXX)
44

55
# The name of the executable created for the application. Change this to change
66
# the on-disk name of your application.
7-
set(BINARY_NAME "Skysync")
7+
set(BINARY_NAME "fileserver")
88

99
# Explicitly opt in to modern CMake behaviors to avoid warnings with recent
1010
# versions of CMake.

0 commit comments

Comments
 (0)