merge branches
This commit is contained in:
@@ -22,7 +22,7 @@ class AuthService {
|
||||
var data = jsonEncode({"password": password, "username": username});
|
||||
|
||||
final result = await _networkManager.makeRequest(
|
||||
'/admin/v1/profile/login',
|
||||
'/api/v1/profile/login',
|
||||
method: 'POST',
|
||||
(json) => LoginResponseModel.fromJson(json),
|
||||
data: data,
|
||||
@@ -31,14 +31,14 @@ class AuthService {
|
||||
if (result is Ok<LoginResponseModel>) {
|
||||
final prefs = await SharedPreferences.getInstance();
|
||||
final token = result.value.data.accessToken;
|
||||
await prefs.setString('bearer', token);
|
||||
await prefs.setString('bearer', token!);
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
Future<Result<LogoutResponse>> logout() async {
|
||||
final result = await _networkManager.makeRequest(
|
||||
'/admin/v1/profile/logout',
|
||||
'/api/v1/profile/logout',
|
||||
method: 'DELETE',
|
||||
(json) => LogoutResponse.fromJson(json),
|
||||
);
|
||||
|
||||
Reference in New Issue
Block a user