ifwarewp
Forum Replies Created
-
Forum: Plugins
In reply to: [One Time Login] Trying the ‘Example with cUrl’Expected “one-time login URLs for any existing user”. User ‘auser’ exists. But the cUrl call returns Site’s front page instead of a link to login page. What do I miss here, please? It is a dev site to figure out this Plugin. Thank you for your time and advice.
curl -X POST https://ifwtrainin3dev.wpenginepowered.com/wp-json/one-time-login/v1/token -H ‘authorization: Basic dGVzdDpQYXNzQWNlZ2kjMj8z’ -H ‘cache-control: no-cache’ -H ‘Content-Type: application/json’ -d ‘{“user”:”auser”,”count”: 3,”delay-delete”: true}’
Forum: Plugins
In reply to: [One Time Login] Trying the ‘Example with cUrl’Once added the ‘Content-Type’ header, response has changed. The user ‘test’ has full ‘admin’ permissions. This POST request is posted using same user ‘test’. Could this create a ‘loop’?
- ?[‘url’]=”https://my_domain.com/wp-json/one-time-login/v1/token”
- [‘body’]='{\n \”delay-delete\”: true,\n \”count\”: 3,\n \”user\”: \”test\”\n}’
- [‘headers’]=table
- [‘Content-Type’]=’application/json’
- [‘authorization’]=’Basic dA********9z’
The authentication header has “test:<password>” encoded in base64.
Response:
{“code”:”rest_forbidden”,”message”:”Sorry, you are not allowed to do that.”,”data”:{“status”:401}}
Thank you for looking into this.
Done! Thank you!
Hello again ?? with good news, this time. Your understanding of the goal is correct and it works now. The updated action+function code was placed into the beginning of themes functions.php file. Thank you so much for your excellent help!
Hello Mustafa,
Your immediate availability and dedication to help are greatly appreciated. Both ways, either to add a code snippet to the themes functions.php or alternatively to add the file ‘pre-filled-email-with-magic-login.php‘ to ../mu-plugins didn’t work for me. Not sure how to proceed… Thank you for your help.
Thank you for this detailed and helpful response. Does the file ‘pre-filled-email-with-magic-login.php‘ need to be stored into the ../magic-plugin/includes path?