Skip to content

Commit e87f71e

Browse files
committed
Allow redirect url override
1 parent 2fe5ee6 commit e87f71e

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

app/controller/user/login-trait.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,8 @@
2828
use Vvveb\System\Validator;
2929

3030
trait LoginTrait {
31+
protected $redirectUrl;
32+
3133
function login() {
3234
if (isset($this->request->post['logout'])) {
3335
$success = __('Logout successful!');
@@ -51,7 +53,7 @@ function login() {
5153
$this->session->close();
5254
$this->view->success['login'] = $success;
5355
$this->view->global['user_id'] = $user['user_id'];
54-
$this->redirect('/user');
56+
$this->redirect($this->redirectUrl ?? '/user');
5557
} else {
5658
//user not found or wrong password
5759
$this->view->errors['login'] = __('Authentication failed, wrong email or password!');

0 commit comments

Comments
 (0)