auth: use sessions
This commit is contained in:
@@ -7,7 +7,7 @@ import 'package:sheetless/core/models/config.dart';
|
||||
import 'package:sheetless/core/models/sheet.dart';
|
||||
|
||||
/// Keys for secure storage (credentials and tokens).
|
||||
enum SecureStorageKey { url, jwt, email }
|
||||
enum SecureStorageKey { url, refreshToken, username }
|
||||
|
||||
/// Data class for storing annotations with metadata.
|
||||
class StoredAnnotation {
|
||||
@@ -110,7 +110,7 @@ class StorageService {
|
||||
/// while preserving server URL and email for convenience.
|
||||
Future<void> clearAllUserData() async {
|
||||
// Clear JWT token
|
||||
await writeSecure(SecureStorageKey.jwt, null);
|
||||
await writeSecure(SecureStorageKey.refreshToken, null);
|
||||
|
||||
// Clear all Hive boxes
|
||||
final sheetAccessTimesBox = await Hive.openBox(_sheetAccessTimesBox);
|
||||
@@ -123,7 +123,8 @@ class StorageService {
|
||||
await changeQueueBox.clear();
|
||||
|
||||
final annotationsBox = await Hive.openBox(_annotationsBox);
|
||||
await annotationsBox.clear();
|
||||
await annotationsBox
|
||||
.clear(); // TODO: this can lead to a loss of important data. Make sure the user is warned
|
||||
|
||||
final sheetsBox = await Hive.openBox(_sheetsBox);
|
||||
await sheetsBox.clear();
|
||||
|
||||
Reference in New Issue
Block a user