mirror of
https://github.com/Bubka/2FAuth.git
synced 2024-11-08 01:14:29 +01:00
Show inoperative Request pwd form in Demo
This commit is contained in:
parent
6b0d605d01
commit
4303af509f
@ -63,6 +63,7 @@ class Kernel extends HttpKernel
|
||||
'signed' => \Illuminate\Routing\Middleware\ValidateSignature::class,
|
||||
'throttle' => \Illuminate\Routing\Middleware\ThrottleRequests::class,
|
||||
'verified' => \Illuminate\Auth\Middleware\EnsureEmailIsVerified::class,
|
||||
'AvoidResetPassword' => \App\Http\Middleware\AvoidPasswordResetInDemo::class,
|
||||
];
|
||||
|
||||
/**
|
||||
|
26
app/Http/Middleware/AvoidPasswordResetInDemo.php
Normal file
26
app/Http/Middleware/AvoidPasswordResetInDemo.php
Normal file
@ -0,0 +1,26 @@
|
||||
<?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);
|
||||
}
|
||||
}
|
@ -7,7 +7,7 @@
|
||||
<form-buttons :isBusy="form.isBusy" :caption="$t('auth.sign_in')" />
|
||||
</form>
|
||||
<p>{{ $t('auth.forms.dont_have_account_yet') }} <router-link :to="{ name: 'register' }" class="is-link">{{ $t('auth.register') }}</router-link></p>
|
||||
<p v-if="!$root.appSettings.isDemoApp">{{ $t('auth.forms.forgot_your_password') }} <router-link :to="{ name: 'password.request' }" class="is-link">{{ $t('auth.forms.request_password_reset') }}</router-link></p>
|
||||
<p>{{ $t('auth.forms.forgot_your_password') }} <router-link :to="{ name: 'password.request' }" class="is-link">{{ $t('auth.forms.request_password_reset') }}</router-link></p>
|
||||
</form-wrapper>
|
||||
</template>
|
||||
|
||||
@ -44,7 +44,7 @@
|
||||
this.$notify({ type: 'is-danger', text: this.$t('auth.forms.password_do_not_match'), duration:-1 })
|
||||
}
|
||||
else if( error.response.status !== 422 ) {
|
||||
|
||||
|
||||
this.$router.push({ name: 'genericError', params: { err: error.response } });
|
||||
}
|
||||
});
|
||||
|
@ -35,6 +35,7 @@
|
||||
'forgot_your_password' => 'Forgot your password?',
|
||||
'request_password_reset' => 'Request a password reset',
|
||||
'reset_password' => 'Reset password',
|
||||
'no_reset_password_in_demo' => 'No reset in Demo mode',
|
||||
'new_password' => 'New password',
|
||||
'current_password' => [
|
||||
'label' => 'Current password',
|
||||
|
@ -35,6 +35,7 @@
|
||||
'forgot_your_password' => 'Mot de passe oublié ?',
|
||||
'request_password_reset' => 'Réinitialiser le mot de passe',
|
||||
'reset_password' => 'Mot de passe oublié',
|
||||
'no_reset_password_in_demo' => 'Réinitialisation impossible en mode Démo',
|
||||
'new_password' => 'Nouveau mot de passe',
|
||||
'current_password' => [
|
||||
'label' => 'Mot de passe actuel',
|
||||
|
@ -19,7 +19,7 @@
|
||||
Route::post('checkuser', 'Auth\RegisterController@checkUser');
|
||||
Route::post('register', 'Auth\RegisterController@register');
|
||||
|
||||
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail');
|
||||
Route::post('password/email', 'Auth\ForgotPasswordController@sendResetLinkEmail')->middleware('AvoidResetPassword');
|
||||
Route::post('password/reset', 'Auth\ResetPasswordController@reset')->name('password.reset');
|
||||
|
||||
});
|
||||
|
Loading…
Reference in New Issue
Block a user