|
|
|
@ -35,7 +35,7 @@ class BaseAppClient {
|
|
|
|
|
String endPoint, {
|
|
|
|
|
Map<String, dynamic> body,
|
|
|
|
|
Function(dynamic response, int statusCode) onSuccess,
|
|
|
|
|
Function(String error, int statusCode) onFailure,
|
|
|
|
|
Function(String error, int statusCode) onFailure,bool isAllowAny = false
|
|
|
|
|
}) async {
|
|
|
|
|
String url = BASE_URL + endPoint;
|
|
|
|
|
try {
|
|
|
|
@ -105,10 +105,13 @@ class BaseAppClient {
|
|
|
|
|
if (!parsed['IsAuthenticated']) {
|
|
|
|
|
if (body['OTP_SendType'] != null) {
|
|
|
|
|
onFailure(getError(parsed), statusCode);
|
|
|
|
|
} else {
|
|
|
|
|
} else if(!isAllowAny){
|
|
|
|
|
await helpers.logout();
|
|
|
|
|
helpers.showErrorToast('Your session expired Please login agian');
|
|
|
|
|
}
|
|
|
|
|
if(isAllowAny){
|
|
|
|
|
onFailure(getError(parsed), statusCode);
|
|
|
|
|
}
|
|
|
|
|
} else if (parsed['MessageStatus'] == 1) {
|
|
|
|
|
if (!parsed['IsAuthenticated'])
|
|
|
|
|
onFailure(getError(parsed), statusCode);
|
|
|
|
|