Fix auth login error

master v0.1.0
root 2 years ago
parent 56a57fe555
commit ba9d0893b7

@ -5,7 +5,7 @@
"keywords": ["application", "website", "development", "framework", "PHP", "PHP7"], "keywords": ["application", "website", "development", "framework", "PHP", "PHP7"],
"license": "MIT", "license": "MIT",
"require": { "require": {
"php": ">=5.6.33", "php": "7.4.*",
"composer/installers": "~1.0", "composer/installers": "~1.0",
"fuel/core": "1.8.*", "fuel/core": "1.8.*",
"fuel/auth": "1.8.*", "fuel/auth": "1.8.*",

@ -34,4 +34,4 @@ services:
# COMPOSER # COMPOSER
COMPOSER_VERSION: 1 COMPOSER_VERSION: 1
volumes: volumes:
- .:/app - .:/app

@ -7,6 +7,7 @@ use Fuel\Core\FuelException;
use Fuel\Core\Input; use Fuel\Core\Input;
use Fuel\Core\Migrate; use Fuel\Core\Migrate;
use Fuel\Core\Request; use Fuel\Core\Request;
use Fuel\Core\Response;
use Fuel\Core\Str; use Fuel\Core\Str;
class Controller_Rest_Install extends Controller_Rest class Controller_Rest_Install extends Controller_Rest
@ -115,7 +116,7 @@ class Controller_Rest_Install extends Controller_Rest
public function post_admin() public function post_admin()
{ {
try { try {
$config = Config::load('db', true); $configCrypt = Config::load('crypt', true);
$email = Input::post('email'); $email = Input::post('email');
$username = Input::post('username'); $username = Input::post('username');
@ -128,7 +129,7 @@ class Controller_Rest_Install extends Controller_Rest
$user = Model_User::forge(array( $user = Model_User::forge(array(
'username' => $username, 'username' => $username,
'email' => $email, 'email' => $email,
'password' => hash('sha512', $config['default']['hash'] . $password), 'password' => hash('sha512', $configCrypt['sodium']['cipherkey'] . $password),
'admin' => 1, 'admin' => 1,
'lastlogin' => time() 'lastlogin' => time()
)); ));

Loading…
Cancel
Save