Skip to content
This repository has been archived by the owner on Nov 2, 2020. It is now read-only.

Commit

Permalink
fix(Auth/Login): Fix User Can't Login
Browse files Browse the repository at this point in the history
  • Loading branch information
Rhilip committed Jul 29, 2019
1 parent 7057f26 commit 3ca05fc
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions apps/models/form/Auth/UserLoginForm.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@ class UserLoginForm extends Validator

// Key Information of User Session
private $sessionLength = 64;
private $sessionSaveKey = 'SESSION:user_set';

// Cookie
private $cookieExpires = 0x7fffffff;
Expand All @@ -47,7 +46,6 @@ class UserLoginForm extends Validator
public function __construct(array $config = [])
{
parent::__construct($config);
$this->sessionSaveKey = app()->site->getCurUser()->sessionSaveKey;
}

public static function inputRules()
Expand Down Expand Up @@ -128,7 +126,7 @@ public function createUserSession()
{
$userId = $this->self['id'];

$exist_session_count = app()->redis->zCount($this->sessionSaveKey, $userId, $userId);
$exist_session_count = app()->redis->zCount(Constant::mapUserSessionToId, $userId, $userId);
if ($exist_session_count < config('base.max_per_user_session')) {
/**
* SessionId Format:
Expand Down Expand Up @@ -162,7 +160,7 @@ public function createUserSession()
])->execute();

// Add this session id in Redis Cache
app()->redis->zAdd($this->sessionSaveKey, $userId, $userSessionId);
app()->redis->zAdd(Constant::mapUserSessionToId, $userId, $userSessionId);

// Set User Cookie
$cookieExpire = $this->cookieExpires;
Expand Down

0 comments on commit 3ca05fc

Please sign in to comment.