mirror of
https://github.com/pixelfed/pixelfed.git
synced 2024-11-30 02:03:16 +00:00
63 lines
1.6 KiB
PHP
63 lines
1.6 KiB
PHP
<?php
|
|
|
|
namespace App\Http\Controllers\Auth;
|
|
|
|
use App\Http\Controllers\Controller;
|
|
use Illuminate\Foundation\Auth\SendsPasswordResetEmails;
|
|
use App\Services\BouncerService;
|
|
use Illuminate\Http\Request;
|
|
|
|
class ForgotPasswordController extends Controller
|
|
{
|
|
/*
|
|
|--------------------------------------------------------------------------
|
|
| Password Reset Controller
|
|
|--------------------------------------------------------------------------
|
|
|
|
|
| This controller is responsible for handling password reset emails and
|
|
| includes a trait which assists in sending these notifications from
|
|
| your application to your users. Feel free to explore this trait.
|
|
|
|
|
*/
|
|
|
|
use SendsPasswordResetEmails;
|
|
|
|
/**
|
|
* Create a new controller instance.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function __construct()
|
|
{
|
|
$this->middleware('guest');
|
|
}
|
|
|
|
/**
|
|
* Display the form to request a password reset link.
|
|
*
|
|
* @return \Illuminate\View\View
|
|
*/
|
|
public function showLinkRequestForm()
|
|
{
|
|
if(config('pixelfed.bouncer.cloud_ips.ban_logins')) {
|
|
abort_if(BouncerService::checkIp(request()->ip()), 404);
|
|
}
|
|
|
|
return view('auth.passwords.email');
|
|
}
|
|
|
|
/**
|
|
* Validate the email for the given request.
|
|
*
|
|
* @param \Illuminate\Http\Request $request
|
|
* @return void
|
|
*/
|
|
protected function validateEmail(Request $request)
|
|
{
|
|
if(config('pixelfed.bouncer.cloud_ips.ban_logins')) {
|
|
abort_if(BouncerService::checkIp($request->ip()), 404);
|
|
}
|
|
|
|
$request->validate(['email' => 'required|email']);
|
|
}
|
|
}
|