PluginProbe
Yoast SEO – Advanced SEO with real-time guidance and built-in AI / 28.3
Yoast SEO – Advanced SEO with real-time guidance and built-in AI v28.3
28.5 28.4 28.3 28.2 28.1 28.0 27.9 27.8 27.7 27.6 27.5 trunk 18.0 18.1 18.2 18.3 18.4 18.4.1 18.5 18.5.1 18.6 18.7 18.8 18.9 19.0 All 129 releases
wordpress-seo / src / ai / authorization / user-interface / refresh-callback-route.php

refresh-callback-route.php in Yoast SEO – Advanced SEO with real-time guidance and built-in AI 28.3, at src/ai/authorization/user-interface/refresh-callback-route.php

61 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 // phpcs:disable Yoast.NamingConventions.NamespaceName.TooLong -- Needed in the folder structure.
4 namespace Yoast\WP\SEO\AI\Authorization\User_Interface;
5
6 /**
7 * Registers the callback route used in the authorization process.
8 *
9 * @makePublic
10 *
11 * @phpcs:disable Yoast.NamingConventions.ObjectNameDepth.MaxExceeded
12 */
13 class Refresh_Callback_Route extends Abstract_Callback_Route {
14
15 /**
16 * The prefix for this route.
17 *
18 * @var string
19 */
20 public const ROUTE_PREFIX = '/ai_generator/refresh_callback';
21
22 /**
23 * Registers routes with WordPress.
24 *
25 * @return void
26 */
27 public function register_routes() {
28 \register_rest_route(
29 parent::ROUTE_NAMESPACE,
30 self::ROUTE_PREFIX,
31 [
32 'methods' => 'POST',
33 'args' => [
34 'access_jwt' => [
35 'required' => true,
36 'type' => 'string',
37 'description' => 'The access JWT.',
38 ],
39 'refresh_jwt' => [
40 'required' => true,
41 'type' => 'string',
42 'description' => 'The JWT to be used when the access JWT needs to be refreshed.',
43 ],
44 'code_challenge' => [
45 'required' => true,
46 'type' => 'string',
47 'description' => 'The SHA266 of the verification code used to check the authenticity of a callback call.',
48 ],
49 'user_id' => [
50 'required' => true,
51 'type' => 'integer',
52 'description' => 'The id of the user associated to the code verifier.',
53 ],
54 ],
55 'callback' => [ $this, 'callback' ],
56 'permission_callback' => '__return_true',
57 ],
58 );
59 }
60 }
61