Feature/phone register (#11)
Co-authored-by: ISMAIL MASSERAN <topaz@ISMAILs-Macbook.local> Co-authored-by: ISMAIL MASSERAN <topaz@Mac.dlinkrouter.local> Reviewed-on: #11
This commit was merged in pull request #11.
This commit is contained in:
@@ -57,9 +57,9 @@ class FortifyServiceProvider extends ServiceProvider
|
||||
});
|
||||
|
||||
RateLimiter::for('email-verification', function (Request $request) {
|
||||
$throttleKey = Str::transliterate(Str::lower($request->input('email', '')).'|'.$request->ip());
|
||||
$throttleKey = Str::transliterate($request->route('id', '').'|'.$request->ip());
|
||||
|
||||
return Limit::perMinute(5)->by($throttleKey);
|
||||
return Limit::perMinute(6)->by($throttleKey);
|
||||
});
|
||||
|
||||
RateLimiter::for('email-verification-resend', function (Request $request) {
|
||||
@@ -80,6 +80,18 @@ class FortifyServiceProvider extends ServiceProvider
|
||||
return Limit::perMinute(5)->by($throttleKey);
|
||||
});
|
||||
|
||||
RateLimiter::for('phone-verification-send', function (Request $request) {
|
||||
$throttleKey = Str::transliterate($request->input('phone_number', '').'|'.$request->ip());
|
||||
|
||||
return Limit::perMinute(5)->by($throttleKey);
|
||||
});
|
||||
|
||||
RateLimiter::for('phone-verification-verify', function (Request $request) {
|
||||
$throttleKey = Str::transliterate($request->input('phone_number', '').'|'.$request->ip());
|
||||
|
||||
return Limit::perMinute(5)->by($throttleKey);
|
||||
});
|
||||
|
||||
Fortify::authenticateUsing(function (Request $request) {
|
||||
$user = User::where('email', $request->email)->first();
|
||||
|
||||
@@ -87,10 +99,6 @@ class FortifyServiceProvider extends ServiceProvider
|
||||
$shouldBypassPassword = config('app.env', 'local');
|
||||
|
||||
if ($user && ($shouldBypassPassword || Hash::check($request->password, $user->password))) {
|
||||
if (! $user->hasVerifiedEmail()) {
|
||||
return $user;
|
||||
}
|
||||
|
||||
if (! $user->canAuthenticate()) {
|
||||
throw ValidationException::withMessages([
|
||||
'email' => [$user->getLoginRestrictionMessage()],
|
||||
|
||||
Reference in New Issue
Block a user