Skip to content

Commit

Permalink
Merge pull request #13 from crosa7/fix-timestamps
Browse files Browse the repository at this point in the history
  • Loading branch information
mychidarko committed May 21, 2023
2 parents b9c3236 + 58c8dcf commit 0f3cbd7
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Auth.php
Expand Up @@ -145,7 +145,7 @@ public static function register(array $credentials, array $uniques = [])
}

if (static::$settings['USE_TIMESTAMPS']) {
$now = (new \Leaf\Date())->tick()->now();
$now = (new \Leaf\Date())->tick()->format(static::$settings['TIMESTAMP_FORMAT']);
$credentials['created_at'] = $now;
$credentials['updated_at'] = $now;
}
Expand Down Expand Up @@ -266,7 +266,7 @@ public static function update(array $credentials, array $uniques = [])
}

if (static::$settings['USE_TIMESTAMPS']) {
$credentials['updated_at'] = (new \Leaf\Date())->tick()->now();
$credentials['updated_at'] = (new \Leaf\Date())->tick()->format(static::$settings['TIMESTAMP_FORMAT']);
}

if (count($uniques) > 0) {
Expand Down
1 change: 1 addition & 0 deletions src/Auth/Core.php
Expand Up @@ -27,6 +27,7 @@ class Core
'DB_TABLE' => 'users',
'AUTH_NO_PASS' => false,
'USE_TIMESTAMPS' => true,
'TIMESTAMP_FORMAT' => 'c',
'PASSWORD_ENCODE' => null,
'PASSWORD_VERIFY' => null,
'PASSWORD_KEY' => 'password',
Expand Down

0 comments on commit 0f3cbd7

Please sign in to comment.