Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Merge pull request #1438 from michaellrowley/security-patch
  • Loading branch information
star7th committed Aug 3, 2021
2 parents 034328a + db53edb commit 4b962c1
Showing 1 changed file with 2 additions and 2 deletions.
Expand Up @@ -166,7 +166,7 @@ public function getLoginSecretKey(){
$this->checkAdmin();
$login_secret_key = D("Options")->get("login_secret_key") ;
if(!$login_secret_key){
$login_secret_key = md5("rgrsfsrfsrf".time().rand(1,9000000000000000).uniqid());
$login_secret_key = bin2hex( random_bytes( 16 ) );
D("Options")->set("login_secret_key",$login_secret_key) ;
}
$this->sendResult(array("login_secret_key"=>$login_secret_key));
Expand All @@ -176,7 +176,7 @@ public function getLoginSecretKey(){
public function resetLoginSecretKey(){
$login_user = $this->checkLogin();
$this->checkAdmin();
$login_secret_key = md5("rgrsfsrfsrf".time().rand(1,9000000000000000).uniqid());
$login_secret_key = bin2hex( random_bytes( 16 ) );
D("Options")->set("login_secret_key",$login_secret_key) ;
$this->sendResult(array("login_secret_key"=>$login_secret_key));

Expand Down

0 comments on commit 4b962c1

Please sign in to comment.