Fixes for tax configuration
This commit is contained in:
parent
1e26f3c54e
commit
f8dd0b15af
|
|
@ -135,13 +135,13 @@ class LoginController extends BaseController
|
||||||
|
|
||||||
if (strlen($request->input('one_time_password')) == 0 || !$google2fa->verifyKey(decrypt($user->google_2fa_secret), $request->input('one_time_password'))) {
|
if (strlen($request->input('one_time_password')) == 0 || !$google2fa->verifyKey(decrypt($user->google_2fa_secret), $request->input('one_time_password'))) {
|
||||||
return response()
|
return response()
|
||||||
->json(['message' => ctrans('texts.invalid_one_time_password')], 401)
|
->json(['message' => ctrans('texts.invalid_one_time_password')], 422)
|
||||||
->header('X-App-Version', config('ninja.app_version'))
|
->header('X-App-Version', config('ninja.app_version'))
|
||||||
->header('X-Api-Version', config('ninja.minimum_client_version'));
|
->header('X-Api-Version', config('ninja.minimum_client_version'));
|
||||||
}
|
}
|
||||||
} elseif (strlen($user->google_2fa_secret ?? '') > 2 && !$request->has('one_time_password')) {
|
} elseif (strlen($user->google_2fa_secret ?? '') > 2 && !$request->has('one_time_password')) {
|
||||||
return response()
|
return response()
|
||||||
->json(['message' => ctrans('texts.invalid_one_time_password')], 401)
|
->json(['message' => ctrans('texts.invalid_one_time_password')], 422)
|
||||||
->header('X-App-Version', config('ninja.app_version'))
|
->header('X-App-Version', config('ninja.app_version'))
|
||||||
->header('X-Api-Version', config('ninja.minimum_client_version'));
|
->header('X-Api-Version', config('ninja.minimum_client_version'));
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -168,7 +168,7 @@ class TaxProvider
|
||||||
private function taxShippingAddress(): bool
|
private function taxShippingAddress(): bool
|
||||||
{
|
{
|
||||||
|
|
||||||
if ($this->client->shipping_country_id == "840" && strlen($this->client->shipping_postal_code) > 3) {
|
if ($this->client->shipping_country_id == "840" && strlen($this->client->shipping_postal_code ?? '') > 3) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue