isTokenValid method
Metodo per verificare se il token รจ valido.
Implementation
Future<bool> isTokenValid() async {
if (token == null) return false;
final response = await http.get(
Uri.parse('$endpoint/validate'),
headers: {
'Accept': 'application/json',
'Authorization': 'Bearer $token',
},
);
return response.statusCode == 200;
}