1
0
mirror of https://github.com/flarum/core.git synced 2025-07-31 13:40:20 +02:00

Combine URL generator classes into one

This commit is contained in:
Franz Liedke
2017-06-25 23:33:02 +02:00
parent f824dcfb53
commit b72407440d
19 changed files with 104 additions and 111 deletions

View File

@@ -11,9 +11,9 @@
namespace Flarum\Forum\Controller;
use Flarum\Forum\UrlGenerator;
use Flarum\Http\Controller\ControllerInterface;
use Flarum\Http\SessionAuthenticator;
use Flarum\Http\UrlGenerator;
use Flarum\User\PasswordToken;
use Flarum\User\UserValidator;
use Illuminate\Contracts\Validation\Factory;
@@ -81,7 +81,7 @@ class SavePasswordController implements ControllerInterface
} catch (ValidationException $e) {
$request->getAttribute('session')->set('error', $e->errors()->first());
return new RedirectResponse($this->url->toRoute('resetPassword', ['token' => $token->id]));
return new RedirectResponse($this->url->to('forum')->route('resetPassword', ['token' => $token->id]));
}
$token->user->changePassword($password);
@@ -92,6 +92,6 @@ class SavePasswordController implements ControllerInterface
$session = $request->getAttribute('session');
$this->authenticator->logIn($session, $token->user->id);
return new RedirectResponse($this->url->toBase());
return new RedirectResponse($this->url->to('forum')->base());
}
}