Comments (8)
@y4ahmad I had the same problem and needed to whitelist the /wp-json/contact-form-7/*
endpoint.
from jwt-auth.
Thanks for helping @Gandhi11 :)
Have you tried it @y4ahmad?
from jwt-auth.
@y4ahmad I had the same problem and needed to whitelist the
/wp-json/contact-form-7/*
endpoint.
how will I whitelist the contact form can you explain?
from jwt-auth.
Yo can try below code to whitelist the contact form 7 api request.
add_filter('jwt_auth_default_whitelist', 'custom_jwt_auth_default_whitelist', 10, 1);
function custom_jwt_auth_default_whitelist($whitelist) {
$rest_api_slug = home_url('/wp-json', 'relative');
$whitelist[] = $rest_api_slug . '/contact-form-7/';
return $whitelist;
}
from jwt-auth.
/wp-json/contact-form-7/*
is it on the functions.php file i will put it on the theme
from jwt-auth.
/wp-json/contact-form-7/*
is it on the functions.php file i will put it on the theme
Try to put the code in a plugin. If you use the code in theme funcitons.php, it only runs in front-end calls. The rest-api could be called without front-end.
from jwt-auth.
/wp-json/contact-form-7/*
is it on the functions.php file i will put it on the theme
Try to put the code in a plugin. If you use the code in theme funcitons.php, it only runs in front-end calls. The rest-api could be called without front-end.
Do you mean i should create a file on the contact form plugin and just add it there. Because i want to understand the process before i do it
from jwt-auth.
@MOTY12 you must write your own plugin to add this code, that's simple. If you use the functions.php it only works in fron-end, but if you use a plugin, it will run in admin and rest-api calls too.
The example below will add all contact-form-7 calls in whitelist, because de '*':
<?php
/*
Plugin Name: My Simple Plugin
Description: This is a simple plugin for WordPress.
Version: 1.0
Author: Your Name
*/
function custom_jwt_auth_default_whitelist($endpoints) {
array_push($endpoints,'/wp-json/contact-form-7/v1/*');
return $endpoints;
}
add_filter('jwt_auth_default_whitelist', 'custom_jwt_auth_default_whitelist', 10, 1);
from jwt-auth.
Related Issues (20)
- Status 401 using validate endpoint
- How can I reset / remove token from user? HOT 3
- Dependabot alert on use of `guzzlehttp/psr7` HOT 6
- Whitelist dont work! HOT 8
- Passwords with special characters don't work HOT 3
- Problem with Dokan plugin HOT 1
- Removing tag 3.0.1 from WordPress SVN HOT 16
- Algorithm not allowed — jwt_auth_invalid_token HOT 7
- Requesting a token does not work using Authorization header to pass credentials HOT 3
- Oversight in dependency version for firebase/php-jwt
- Give refresh_token in JSON response HOT 1
- JWTAuth::validate_refresh_token() causes PHP warnings HOT 1
- Automated deploy to WordPress failed but was successful HOT 1
- Additional files to be added to .distignore HOT 4
- Add WhiteList Again to the Version 3 of Plugin
- Intended workflow with access/refresh token HOT 3
- RankMath plugin incompatibility
- API endpoints not whitelisted after remove filter "jwt_auth_whitelist" HOT 6
- Wrong Token and Data Returned HOT 5
- Refresh token is obsolete error received when both login credentials and refresh token cookie is provided
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jwt-auth.