mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-12-27 17:39:25 +01:00
27 lines
565 B
PHP
27 lines
565 B
PHP
|
<?php
|
||
|
|
||
|
namespace App\Http\Middleware;
|
||
|
|
||
|
use Closure;
|
||
|
use Illuminate\Http\Response;
|
||
|
|
||
|
class AvoidPasswordResetInDemo
|
||
|
{
|
||
|
/**
|
||
|
* Handle an incoming request.
|
||
|
*
|
||
|
* @param \Illuminate\Http\Request $request
|
||
|
* @param \Closure $next
|
||
|
* @return mixed
|
||
|
*/
|
||
|
public function handle($request, Closure $next)
|
||
|
{
|
||
|
|
||
|
if( config('app.options.isDemoApp') ) {
|
||
|
return response()->json(['requestFailed' => __('auth.forms.no_reset_password_in_demo')], Response::HTTP_UNAUTHORIZED);
|
||
|
}
|
||
|
|
||
|
return $next($request);
|
||
|
}
|
||
|
}
|