2026-02-25 14:59:20 +08:00
|
|
|
import 'package:equatable/equatable.dart';
|
|
|
|
|
import '../../data/models/auth_response.dart';
|
|
|
|
|
|
2026-03-18 13:35:25 +08:00
|
|
|
enum AuthInvalidationSource { unauthorized401 }
|
|
|
|
|
|
2026-02-25 14:59:20 +08:00
|
|
|
abstract class AuthEvent extends Equatable {
|
|
|
|
|
const AuthEvent();
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
List<Object?> get props => [];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class AuthStarted extends AuthEvent {}
|
|
|
|
|
|
|
|
|
|
class AuthLoggedIn extends AuthEvent {
|
|
|
|
|
final AuthUser user;
|
|
|
|
|
|
|
|
|
|
const AuthLoggedIn({required this.user});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
List<Object?> get props => [user];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
class AuthLoggedOut extends AuthEvent {}
|
2026-03-18 13:35:25 +08:00
|
|
|
|
|
|
|
|
class AuthSessionInvalidated extends AuthEvent {
|
|
|
|
|
final AuthInvalidationSource source;
|
|
|
|
|
|
|
|
|
|
const AuthSessionInvalidated({required this.source});
|
|
|
|
|
|
|
|
|
|
@override
|
|
|
|
|
List<Object?> get props => [source];
|
|
|
|
|
}
|