diff --git a/src/Auth.php b/src/Auth.php index 34968be..67f7958 100644 --- a/src/Auth.php +++ b/src/Auth.php @@ -750,7 +750,9 @@ public function user() } return $this->user = (new User( - $user + $user, + true, + false ))->setDb($this->db); } diff --git a/src/Auth/User.php b/src/Auth/User.php index 5428d73..b69eef3 100644 --- a/src/Auth/User.php +++ b/src/Auth/User.php @@ -64,8 +64,9 @@ class User /** * @param array $data * @param bool $session + * @param bool $regenerate */ - public function __construct($data, $session = true) + public function __construct($data, $session = true, $regenerate = true) { $this->data = $data; @@ -79,7 +80,9 @@ public function __construct($data, $session = true) session_start(); } - session_regenerate_id(); + if ($regenerate) { + session_regenerate_id(); + } if (!Session::has('auth.startedAt')) { Session::set('auth.startedAt', time());