Пример #1
0
 /**
  * Send email with password reset link to requested address
  *
  * @param  App\Http\Requests\Auth\PasswordEmail $request
  * @param  App\Services\EmailInteractionLimiter $limiter
  * @return Illuminate\Http\RedirectResponse
  */
 public function postEmail(PasswordEmail $request, EmailInteractionLimiter $limiter)
 {
     if ($limiter->allowed('passreset')) {
         $this->dispatch(new SendPasswordResetEmail($request->email));
         return back()->withInfo('An email will be sent to ' . $request->email . '. Please, follow the provided link to change your password.');
     } else {
         $expire = config('auth.email_lockout');
         return back()->withDanger(trans_choice('auth.lockout', $expire, compact('expire')));
     }
 }
Пример #2
0
 /**
  * Process request to send signup email
  * @param  App\Http\Requests\Auth\SignupEmail $request
  * @param  App\Services\EmailInteractionLimiter $limiter
  * @return Illuminate\Http\RedirectResponse
  */
 public function postSignupEmail(SignupEmail $request, EmailInteractionLimiter $limiter)
 {
     if ($limiter->allowed('signup')) {
         $this->dispatch(new SendSignupEmail($request->email));
         return back()->withInfo('An email will be sent to ' . $request->email . '. Please, follow the provided link to finish signup procedure.');
     } else {
         $expire = config('auth.email_lockout');
         return back()->withDanger(trans_choice('auth.lockout', $expire, compact('expire')));
     }
 }
Пример #3
0
 /**
  * [postEmail description]
  * @param  App\Http\Requests\Auth\ChangeEmail   $request
  * @param  App\Services\EmailInteractionLimiter $limiter
  * @return Illuminate\Http\RedirectResponse
  */
 public function postEmail(ChangeEmail $request, EmailInteractionLimiter $limiter)
 {
     $valid = Hash::check($request->password_current, auth()->user()->password);
     if (!$valid) {
         return back()->withDanger('Incorrect current password');
     }
     if ($limiter->allowed('changemail')) {
         $this->dispatch(new SendEmailConfirmation($request->email));
         return back()->withInfo('An email will be sent to ' . $request->email . '. Please, follow the provided link to confirm your new email.');
     } else {
         $expire = config('auth.email_lockout');
         return back()->withDanger(trans_choice('auth.lockout', $expire, compact('expire')));
     }
 }