Finish v1.44.04(473)
This commit is contained in:
commit
36c48f28d1
@ -10,8 +10,8 @@ apply plugin: 'com.google.gms.google-services'
|
||||
|
||||
android {
|
||||
|
||||
def appVersionCode = 472
|
||||
def appVersionName = '1.44.03'
|
||||
def appVersionCode = 473
|
||||
def appVersionName = '1.44.04'
|
||||
|
||||
signingConfigs {
|
||||
release {
|
||||
|
||||
@ -6,11 +6,14 @@ import java.io.IOException;
|
||||
|
||||
import io.jsonwebtoken.Claims;
|
||||
import it.integry.integrywmsnative.core.authentication.JwtUtils;
|
||||
import it.integry.integrywmsnative.core.exception.UnauthorizedAccessException;
|
||||
import it.integry.integrywmsnative.core.settings.SettingsManager;
|
||||
import it.integry.integrywmsnative.core.utility.UtilityDate;
|
||||
import it.integry.integrywmsnative.gest.login.rest.RefreshRESTConsumer;
|
||||
import okhttp3.Interceptor;
|
||||
import okhttp3.Protocol;
|
||||
import okhttp3.Response;
|
||||
import okhttp3.ResponseBody;
|
||||
|
||||
public class AuthInterceptor implements Interceptor {
|
||||
|
||||
@ -30,7 +33,7 @@ public class AuthInterceptor implements Interceptor {
|
||||
var accessToken = SettingsManager.i().getUserSession().getAccessToken();
|
||||
var accessTokenExpiryDate = SettingsManager.i().getUserSession().getAccessTokenExpiryDate();
|
||||
|
||||
if (accessToken != null && (accessTokenExpiryDate == null || UtilityDate.getNowTime().isAfter(accessTokenExpiryDate))) {
|
||||
if (accessToken != null && (accessTokenExpiryDate == null || UtilityDate.getNowTime().isAfter(accessTokenExpiryDate.minusSeconds(20)))) {
|
||||
|
||||
// Make the token refresh request
|
||||
try {
|
||||
@ -45,6 +48,15 @@ public class AuthInterceptor implements Interceptor {
|
||||
.setRefreshTokenExpiryDate(response.getExpiryDate());
|
||||
|
||||
SettingsManager.update();
|
||||
} catch (UnauthorizedAccessException uae) {
|
||||
// Crea una risposta 401 manualmente
|
||||
return new Response.Builder()
|
||||
.request(originalRequest)
|
||||
.protocol(Protocol.HTTP_1_1)
|
||||
.code(401)
|
||||
.message("Unauthorized")
|
||||
.body(ResponseBody.create(new byte[0], null))
|
||||
.build();
|
||||
} catch (Exception e) {
|
||||
return chain.proceed(originalRequest);
|
||||
}
|
||||
|
||||
@ -552,7 +552,8 @@ public class PickingLiberoViewModel {
|
||||
askQuantities(pickedAarts.iterator(), destNewMtbColr, () -> {
|
||||
if (!destNewMtbColr.isEmpty()) {
|
||||
|
||||
destNewMtbColr.forEach(x -> x.setCodJcom(this.mDefaultCommessa.getCodJcom()));
|
||||
if(this.mDefaultCommessa != null)
|
||||
destNewMtbColr.forEach(x -> x.setCodJcom(this.mDefaultCommessa.getCodJcom()));
|
||||
|
||||
MtbColt clonedTestata = (MtbColt) sourceMtbColt.clone();
|
||||
clonedTestata.getMtbColr().clear();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user