Compare commits
1 Commits
2026.03.07
...
2026.03.07
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
78e6c5a4ee |
@@ -9,6 +9,7 @@ class TWP_Mobile_Auth {
|
|||||||
private $secret_key;
|
private $secret_key;
|
||||||
private $token_expiry = 86400; // 24 hours in seconds
|
private $token_expiry = 86400; // 24 hours in seconds
|
||||||
private $refresh_expiry = 2592000; // 30 days in seconds
|
private $refresh_expiry = 2592000; // 30 days in seconds
|
||||||
|
private $current_user_id = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constructor
|
* Constructor
|
||||||
@@ -330,7 +331,7 @@ class TWP_Mobile_Auth {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Store user ID for later use
|
// Store user ID for later use
|
||||||
$request->set_param('_twp_user_id', $payload->user_id);
|
$this->current_user_id = $payload->user_id;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -339,8 +340,7 @@ class TWP_Mobile_Auth {
|
|||||||
* Get current user ID from token
|
* Get current user ID from token
|
||||||
*/
|
*/
|
||||||
public function get_current_user_id() {
|
public function get_current_user_id() {
|
||||||
$request = rest_get_server()->get_request();
|
return $this->current_user_id;
|
||||||
return $request->get_param('_twp_user_id');
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
Reference in New Issue
Block a user