web: migrate health notifications to js_interop; add browser hook
- Replace dart:js with package:js in health_check_service_web.dart\n- Implement showHealthCheckNotification in web/index.html\n- Pin js dependency to ^0.6.7 for flutter_secure_storage_web compatibility auth: harden AuthInterceptor + tests - Allow overrideAuthRepository injection for testing\n- Normalize imports to package: paths\n- Add unit test covering token attach, 401→refresh→retry, and failure path\n- Add integration test skeleton gated by env vars ui/data: map User.companyName to list column - Add companyName to domain User\n- Map UserDto.company?.name\n- Render companyName in user_list cleanup: remove legacy equipment table + unused code; minor warnings - Remove _buildFlexibleTable and unused helpers\n- Remove unused zipcode details and cache retry constant\n- Fix null-aware and non-null assertions\n- Address child-last warnings in administrator dialog docs: update AGENTS.md session context
This commit is contained in:
@@ -1,34 +1,17 @@
|
||||
import 'package:dartz/dartz.dart';
|
||||
import '../../../services/auth_service.dart';
|
||||
import '../../../data/models/user/user_dto.dart';
|
||||
import '../../repositories/auth_repository.dart';
|
||||
import '../../../data/models/auth/auth_user.dart';
|
||||
import '../../../core/errors/failures.dart';
|
||||
import '../base_usecase.dart';
|
||||
|
||||
/// 현재 로그인한 사용자 정보 조회 UseCase
|
||||
class GetCurrentUserUseCase extends UseCase<UserDto?, NoParams> {
|
||||
final AuthService _authService;
|
||||
/// 현재 로그인한 사용자 정보 조회 UseCase (AuthRepository 기반)
|
||||
class GetCurrentUserUseCase extends UseCase<AuthUser, NoParams> {
|
||||
final AuthRepository _authRepository;
|
||||
|
||||
GetCurrentUserUseCase(this._authService);
|
||||
GetCurrentUserUseCase(this._authRepository);
|
||||
|
||||
@override
|
||||
Future<Either<Failure, UserDto?>> call(NoParams params) async {
|
||||
try {
|
||||
final user = await _authService.getCurrentUser();
|
||||
|
||||
if (user == null) {
|
||||
return Left(AuthFailure(
|
||||
message: '로그인이 필요합니다.',
|
||||
code: 'NOT_AUTHENTICATED',
|
||||
));
|
||||
}
|
||||
|
||||
// AuthUser를 UserDto로 변환 (임시로 null 반환)
|
||||
return const Right(null);
|
||||
} catch (e) {
|
||||
return Left(UnknownFailure(
|
||||
message: '사용자 정보를 가져오는 중 오류가 발생했습니다.',
|
||||
originalError: e,
|
||||
));
|
||||
}
|
||||
Future<Either<Failure, AuthUser>> call(NoParams params) async {
|
||||
return await _authRepository.getCurrentUser();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user