mirror of
https://github.com/R0m1k3/xtremflow.git
synced 2026-10-19 05:06:21 +02:00
chore: Update dependencies, switch Flutter web renderer to HTML, replace media_kit with video_player/chewie, and remove Hive volume from Docker setup.
This commit is contained in:
1 parent
3c0d472a31
commit
0ca2835cba
16 files changed
+1282
-688
No files matched your search
@@ -40,14 +40,18 @@ class AuthNotifier extends StateNotifier<AuthState> {
|
||||
|
||||
try {
|
||||
final usersBox = HiveService.usersBox;
|
||||
final passwordHash = HiveService.hashPassword(password);
|
||||
|
||||
// Search for user with matching credentials
|
||||
// Search for user by username
|
||||
final user = usersBox.values.firstWhere(
|
||||
(user) => user.username == username && user.passwordHash == passwordHash,
|
||||
orElse: () => throw Exception('Invalid credentials'),
|
||||
(user) => user.username == username,
|
||||
orElse: () => throw Exception('User not found'),
|
||||
);
|
||||
|
||||
// Verify password using salt-based hashing
|
||||
if (!HiveService.verifyPassword(password, user.passwordHash)) {
|
||||
throw Exception('Invalid password');
|
||||
}
|
||||
|
||||
state = AuthState(currentUser: user, isLoading: false);
|
||||
return true;
|
||||
} catch (e) {
|
||||
@@ -59,6 +63,7 @@ class AuthNotifier extends StateNotifier<AuthState> {
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/// Logout current user
|
||||
void logout() {
|
||||
state = const AuthState();
|
||||
|
||||
Reference in new issue
Block a user