fix: [user:login] Added support of `redirect` after login
parent
e5080e6fda
commit
7ce6507e94
|
@ -120,8 +120,9 @@ class Application extends BaseApplication implements AuthenticationServiceProvid
|
|||
]));
|
||||
\SocialConnect\JWX\JWT::$screw = Configure::check('keycloak.screw') ? Configure::read('keycloak.screw') : 0;
|
||||
}
|
||||
$middlewareQueue->add(new AuthenticationMiddleware($this))
|
||||
->add(new BodyParserMiddleware());
|
||||
$middlewareQueue
|
||||
->add(new BodyParserMiddleware())
|
||||
->add(new AuthenticationMiddleware($this));
|
||||
return $middlewareQueue;
|
||||
}
|
||||
|
||||
|
|
|
@ -20,7 +20,7 @@ use Cake\Core\Configure;
|
|||
$this->Form->setTemplates($template);
|
||||
if (!Configure::check('password_auth.enabled') || Configure::read('password_auth.enabled')) {
|
||||
echo sprintf('<h4 class="text-uppercase fw-light mb-3">%s</h4>', __('Sign In'));
|
||||
echo $this->Form->create(null, ['url' => ['controller' => 'users', 'action' => 'login']]);
|
||||
echo $this->Form->create(null, ['url' => ['controller' => 'users', 'action' => 'login', '?' => ['redirect' => $this->request->getQuery('redirect')],]]);
|
||||
echo $this->Form->control('username', ['label' => 'Username', 'class' => 'form-control mb-2', 'placeholder' => __('Username')]);
|
||||
echo $this->Form->control('password', ['type' => 'password', 'label' => 'Password', 'class' => 'form-control mb-3', 'placeholder' => __('Password')]);
|
||||
echo $this->Form->control(__('Login'), ['type' => 'submit', 'class' => 'btn btn-primary']);
|
||||
|
|
Loading…
Reference in New Issue