Compare commits

...

2 Commits

Author SHA1 Message Date
02e9aa1ac4 token validity increase from 1 hour to 7 days 2026-02-16 07:41:49 +01:00
b3be74e652 changed path to SFTPsync utility in deploy script 2026-02-16 07:35:34 +01:00
2 changed files with 3 additions and 3 deletions

View File

@ -105,7 +105,7 @@ class Users extends \TPsoft\DBmodel\DBmodel {
return password_verify($password, $password_hash); return password_verify($password, $password_hash);
} }
public function generateToken(int $user_id, int $ttl_seconds = 3600): string { public function generateToken(int $user_id, int $ttl_seconds = 604800): string {
if ($user_id <= 0) { if ($user_id <= 0) {
throw new \Exception('Invalid user_id'); throw new \Exception('Invalid user_id');
} }
@ -152,7 +152,7 @@ class Users extends \TPsoft\DBmodel\DBmodel {
if (!hash_equals($stored_token, $token)) { if (!hash_equals($stored_token, $token)) {
return false; return false;
} }
$refresh_expires = date('Y-m-d H:i:s', time() + 3600); $refresh_expires = date('Y-m-d H:i:s', time() + 604800); // 7 days
$updated = $this->user($user_id, array( $updated = $this->user($user_id, array(
'token_expires' => $refresh_expires 'token_expires' => $refresh_expires
)); ));

View File

@ -1,6 +1,6 @@
@echo off @echo off
call php d:\www\von\sftp\sftpsync2.php --host nutrio.tpsoft.org --user igor ^ call php d:\www\sftpsync\src\sftpsync.php --host nutrio.tpsoft.org --user igor ^
--delete-dir /storage/tpsoft.org/nutrio/public ^ --delete-dir /storage/tpsoft.org/nutrio/public ^
--sync d:/www/Nutrio/dist /storage/tpsoft.org/nutrio ^ --sync d:/www/Nutrio/dist /storage/tpsoft.org/nutrio ^
--skip .git ^ --skip .git ^