-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Facebook chnages #179
Facebook chnages #179
Changes from 5 commits
294422d
87ceabf
a8c0981
60f49c8
242fff4
80794f3
5fde6fb
023ca66
3eaeda8
4dc9c60
6011b72
8f05908
5aafbf4
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => '4697b2445a35ed2572dc'); | ||
<?php return array('dependencies' => array('lodash', 'moment', 'react', 'wp-api-fetch', 'wp-data', 'wp-date', 'wp-dom-ready', 'wp-element', 'wp-i18n', 'wp-url'), 'version' => 'bf32d18497e5b84faa45'); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -6,6 +6,7 @@ | |
use NewfoldLabs\WP\Module\ECommerce\Permissions; | ||
use NewfoldLabs\WP\Module\Installer\Services\PluginInstaller; | ||
use NewfoldLabs\WP\ModuleLoader\Container; | ||
use NewfoldLabs\WP\Module\Data\HiiveConnection; | ||
|
||
class IntegrationsController { | ||
|
||
|
@@ -53,6 +54,17 @@ public function register_routes() { | |
), | ||
) | ||
); | ||
\register_rest_route( | ||
$this->namespace, | ||
$this->rest_base . '/hiive', | ||
array( | ||
array( | ||
'methods' => \WP_REST_Server::READABLE, | ||
'callback' => array( $this, 'get_hiive_token' ), | ||
'permission_callback' => array( Permissions::class, 'rest_is_authorized_admin' ), | ||
), | ||
) | ||
); | ||
} | ||
|
||
private function get_plugin_details( $plugin ) { | ||
|
@@ -138,4 +150,17 @@ public function get_razorpay_status() { | |
200 | ||
); | ||
} | ||
|
||
public function get_hiive_token() { | ||
$hiive_token = HiiveConnection::get_auth_token(); | ||
|
||
if ( ! $hiive_token ) {} | ||
return new \WP_REST_Response( | ||
array( | ||
'token' => $hiive_token ? $hiive_token : 'test2', | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We should probably just return an empty string instead of There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We're storing it as |
||
), | ||
200 | ||
); | ||
} | ||
|
||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Where are we using this API? I'm uneasy about passing a Hiive token to the front end.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this endpoint we're using it in facebook module to store
facebook token
againsthiive token
as key-value pair in cloudflare