redirect laravel
[Finalizado Pelo Aluno]
Criador
KAIO JARBSON ARAUJO DE SOUZA
estou tendo um problema em redirecionar a pagina de recuperação de senha para a pagina principal.
segue o codigo do controller:
namespace App\Http\Controllers\Api\v1;
use App\Http\Controllers\Controller;
use App\Http\Requests\Auth\ResetPasswordRequest;
use Illuminate\Auth\Events\PasswordReset;
use Illuminate\Http\Request;
use Illuminate\Support\Facades\Hash;
use Illuminate\Support\Str;
use Illuminate\Support\Facades\Password;
class ResetPasswordController extends Controller
{
public function sendResetLink(Request $request)
{
$request->validate(['email' => 'required|email']);
$status = Password::sendResetLink($request->only('email'));
return $status === Password::RESET_LINK_SENT
? response()->json(['status' => __($status)])
: response()->json(['email' => __($status), 'message' => 'E-mail não consta em nosso sistema!'], 422,);
}
public function resetPassword(ResetPasswordRequest $request)
{
$status = Password::reset(
$request->only('email', 'password', 'password_confirmation', 'token'),
function ($user, $password) {
$user->forceFill([
'password' => Hash::make($password)
])->setRememberToken(Str::random(60));
$user->save();
event(new PasswordReset($user));
}
);
return $status === Password::PASSWORD_RESET
? response()->json(['status' => __($status)])
: response()->json(['email' => [__($status)]], 422);
// return redirect()->route('login');
// return view("login");
}
}
Precisa estar logado para conseguir responder a este ticket!
Clique Aqui Para Entrar!