feat: logout

This commit is contained in:
efrilm
2025-08-16 19:29:21 +07:00
parent e1bde24a83
commit f138e1dcc9
12 changed files with 532 additions and 78 deletions
@@ -1,5 +1,6 @@
import 'dart:developer';
import 'package:dartz/dartz.dart';
import 'package:injectable/injectable.dart';
import 'package:data_channel/data_channel.dart';
@@ -41,4 +42,14 @@ class AuthRemoteDataProvider {
return DC.error(AuthFailure.serverError(e));
}
}
Future<DC<AuthFailure, Unit>> logout() async {
try {
await _apiClient.post(ApiPath.logout);
return DC.data(unit);
} on ApiFailure catch (e, s) {
log('login', name: _logName, error: e, stackTrace: s);
return DC.error(AuthFailure.serverError(e));
}
}
}