feat: logout
This commit is contained in:
@@ -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));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user