From 0dfe1d8afafc59c4a5559c498342668d5a58d6ef Mon Sep 17 00:00:00 2001
From: Jake Vanderwerf <get@jakevanderwerf.ca>
Date: Thu, 23 Jul 2026 22:41:41 +0000
Subject: [PATCH] =Still working away at the Integrations overhaul
---
inc/rest/routes/Invitations.php | 13 ++++++-------
1 files changed, 6 insertions(+), 7 deletions(-)
diff --git a/inc/rest/routes/Invitations.php b/inc/rest/routes/Invitations.php
index 7cccb3e..6322115 100644
--- a/inc/rest/routes/Invitations.php
+++ b/inc/rest/routes/Invitations.php
@@ -43,7 +43,6 @@
Route::for('invitations')
->get([$this, 'getInvitations'])
->args([
- 'user' => 'int|required',
'to_term' => 'int',
'taxonomy' => 'string',
'status' => 'string|enum:all,pending,accepted,rejected,expired,revoked|default:all',
@@ -54,13 +53,13 @@
->post([$this, 'createInvitationRequest'])
->args([
- 'user' => 'int|required',
'action' => 'string|enum:create,revoke,refresh|default:create',
'invites' => 'array',
'invitation_id' => 'int'
])
->auth('verified')
- ->rateLimit(10, 300);
+ ->rateLimit(10, 300)
+ ->register();
}
/**
@@ -68,12 +67,12 @@
*/
public function getInvitations(WP_REST_Request $request): WP_REST_Response
{
- $userID = $request->get_param('user');
+ $userID = get_current_user_id();
$termID = $request->get_param('to_term');
$taxonomy = $request->get_param('taxonomy');
// Validate user
- if (get_current_user_id() !== $userID) {
+ if (!$userID) {
return $this->unauthorized('Invalid user');
}
@@ -184,11 +183,11 @@
*/
public function createInvitationRequest(WP_REST_Request $request): WP_REST_Response
{
- $userID = $request->get_param('user');
+ $userID = get_current_user_id();
$action = $request->get_param('action');
// Validate user
- if (get_current_user_id() !== $userID) {
+ if (!$userID) {
return $this->unauthorized('Invalid user');
}
--
Gitblit v1.10.0