bug fix on MNO module
This commit is contained in:
@@ -94,7 +94,7 @@ class NetworkOperatorsController extends Controller
|
||||
'services' => $request->services,
|
||||
'support_emails' => $request->support_emails,
|
||||
'finance_emails' => $request->finance_emails,
|
||||
'buying_rate' => $request->buying_rate,
|
||||
'buying_rate' => $request->buying_rate ?? 0,
|
||||
'rate_type' => $request->rate_type,
|
||||
'payment_terms' => $request->payment_terms,
|
||||
'connection_type' => $request->connection_type,
|
||||
|
||||
@@ -3,6 +3,8 @@
|
||||
use Illuminate\Foundation\Application;
|
||||
use Illuminate\Foundation\Configuration\Exceptions;
|
||||
use Illuminate\Foundation\Configuration\Middleware;
|
||||
use Symfony\Component\HttpKernel\Exception\HttpException;
|
||||
use Illuminate\Http\Request;
|
||||
|
||||
return Application::configure(basePath: dirname(__DIR__))
|
||||
->withRouting(
|
||||
@@ -14,5 +16,24 @@ return Application::configure(basePath: dirname(__DIR__))
|
||||
//
|
||||
})
|
||||
->withExceptions(function (Exceptions $exceptions) {
|
||||
//
|
||||
$exceptions->render(function (HttpException $e, Request $request) {
|
||||
if ($e->getStatusCode() === 419) {
|
||||
|
||||
if ($request->expectsJson()) {
|
||||
return response()->json([
|
||||
'message' => 'Your session has expired. Please refresh the page and try again.'
|
||||
], 419);
|
||||
}
|
||||
|
||||
// fallback('/login') ensures that if the session was completely lost,
|
||||
// it defaults back to the login page instead of crashing or going to the root URL.
|
||||
// return redirect()->back()->fallback('/login')
|
||||
// ->withInput($request->except('password'))
|
||||
// ->withErrors(['email' => 'Your session expired due to inactivity. Please try logging in again.']);
|
||||
// The third parameter sets '/login' as the fallback if the Referer header is missing
|
||||
return redirect()->back(302, [], '/login')
|
||||
->withInput($request->except('password'))
|
||||
->withErrors(['email' => 'Your session expired due to inactivity. Please try logging in again.']);
|
||||
}
|
||||
});
|
||||
})->create();
|
||||
Reference in New Issue
Block a user