Closed lmsvr closed 2 years ago
$userId = $auth->admin()->createUser($_POST['test@test.com'], $_POST['test'], $_POST['test']);
Check
error_reporting(E_ALL);
print $_POST['test@test.com'];
print $_POST['test'];
How do you set both?
Thanks for your reply,
The error reporting was in fact turned off as your 'hint' got me moving in the right direction... All is working now!
For anyone's reference as this may be viewed by others my solution was to add... ini_set('display_errors', 1);
as early as possible in my PHP code which displayed where my mistake was
Thanks, @eypsilon!
@lmsvr Thanks for reporting what worked for you.
For some reason I can't register a first user to initiate the auth system, I keep getting the result: Invalid email address
I Verified User & Pass for database and successfully connecting What could I possibly be doing wrong?
Script below is after successful database connection...
require_once $GLOBALS['CORE_ROOT'] . '/vendor/autoload.php';
$auth = new \Delight\Auth\Auth($db);
try { $userId = $auth->admin()->createUser($_POST['test@test.com'], $_POST['test'], $_POST['test']);
} catch (\Delight\Auth\InvalidEmailException $e) { die('Invalid email address'); } catch (\Delight\Auth\InvalidPasswordException $e) { die('Invalid password'); } catch (\Delight\Auth\UserAlreadyExistsException $e) { die('User already exists'); }