[CORE][UX] Save previous url to redirect back after registering
This commit is contained in:
parent
ead29a636d
commit
17f854b1d9
@ -101,7 +101,7 @@ class GNUsocial implements EventSubscriberInterface
|
|||||||
$this->session = $sess;
|
$this->session = $sess;
|
||||||
$this->security = $sec;
|
$this->security = $sec;
|
||||||
|
|
||||||
$this->register();
|
$this->initialize();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -109,7 +109,7 @@ class GNUsocial implements EventSubscriberInterface
|
|||||||
*
|
*
|
||||||
* @param EventDispatcherInterface $event_dispatcher
|
* @param EventDispatcherInterface $event_dispatcher
|
||||||
*/
|
*/
|
||||||
public function register(): void
|
public function initialize(): void
|
||||||
{
|
{
|
||||||
Log::setLogger($this->logger);
|
Log::setLogger($this->logger);
|
||||||
Event::setDispatcher($this->event_dispatcher);
|
Event::setDispatcher($this->event_dispatcher);
|
||||||
@ -151,11 +151,11 @@ class GNUsocial implements EventSubscriberInterface
|
|||||||
$request = $event->getRequest();
|
$request = $event->getRequest();
|
||||||
|
|
||||||
// Save the target path, so we can redirect back after logging in
|
// Save the target path, so we can redirect back after logging in
|
||||||
if (!(!$event->isMasterRequest() || $request->isXmlHttpRequest() || 'login' === $request->attributes->get('_route'))) {
|
if (!(!$event->isMasterRequest() || $request->isXmlHttpRequest() || in_array($request->attributes->get('_route'), ['login', 'initialize']))) {
|
||||||
$this->saveTargetPath($this->session, 'main', $request->getUri());
|
$this->saveTargetPath($this->session, 'main', $request->getBaseUrl());
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->register();
|
$this->initialize();
|
||||||
return $event;
|
return $event;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -171,7 +171,7 @@ class GNUsocial implements EventSubscriberInterface
|
|||||||
public function onCommand(ConsoleCommandEvent $event,
|
public function onCommand(ConsoleCommandEvent $event,
|
||||||
string $event_name): ConsoleCommandEvent
|
string $event_name): ConsoleCommandEvent
|
||||||
{
|
{
|
||||||
$this->register();
|
$this->initialize();
|
||||||
return $event;
|
return $event;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user