This repository was archived by the owner on Nov 19, 2025. It is now read-only.
File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff line change 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" ,
Original file line number Diff line number Diff 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,
Original file line number Diff line number Diff line change 11import 'package:shared_preferences/shared_preferences.dart' ;
2+ import 'package:jwt_decoder/jwt_decoder.dart' ;
23
34class 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 {
Original file line number Diff line number Diff 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:
Original file line number Diff line number Diff 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
5455dev_dependencies :
5556 flutter_test :
Original file line number Diff line number Diff 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.
You can’t perform that action at this time.
0 commit comments