Support » Plugin: weForms - Easy Drag & Drop Contact Form Builder For WordPress » nonce error for web spa form submit

  • Resolved sadik2303

    (@sadik2303)


    Hello there,
    I am using WordPress as backend where weForms plugin already installed and separated vue app as frontend.

    I am trying to save data from my frontend application to my backend through weFroms. But getting error response from the plugin. I already debug the source coede, as far i understand i have to pass _wpnonce from front end.

    Now my question is how can i get value of _wpnonce in my frontend application?

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Support Elana Davis

    (@elanasparkle)

    Hello @sadik2303,

    ‚ÄčThank you for reaching out to support! I’m not sure what you are trying to accomplish. Are you able to provide more details on what you are trying to accomplish, and I might be able to assist further?

    Thanks
    Elana D.

    Thread Starter sadik2303

    (@sadik2303)

    Hi,
    We are getting Unauthorized operation response from the weForms plugin.
    Please check the following url: https://tinyurl.com/ye5y9nze

    Plugin Support Elana Davis

    (@elanasparkle)

    Hello @sadik2303,

    Not sure what you are trying to accomplish. It sounds like you are trying to grab the information from the form and post it elsewhere, but if you are trying to find the value of _wpnonce, you can verify it then call the action from your call.

    if isset( $form[‘_nonce’], $form[‘_action’] ){

    Thanks
    Elana D.

    Thread Starter sadik2303

    (@sadik2303)

    We are calling rest api, But in your plugin there is _wpnonce check which is wrong i think. Please talk to your developer who will understand the issue better.

    Thank you

    Plugin Support Elana Davis

    (@elanasparkle)

    Hello @sadik2303,

    I’m not sure where you are getting the error on and looking at the coding, there are multiple places called the below repository/link. It seems like you might need to create a ‘weforms’ nonce and send it as _wpnonce

    Example:
    wp_verify_nonce( $_POST[‘_wpnonce’] , ‘weforms’ );

    Operations called:
    https://github.com/BoldGrid/weforms/search?q=%22Unauthorized+operation%22

    However, another option you can do is use the WordPress API to accomplish what you are trying to get. Using the Rest API to get the nonce and send a post to request that way.

    https://developer.wordpress.org/rest-api/using-the-rest-api/authentication/

    Thanks
    Elana D.

    Plugin Support Elana Davis

    (@elanasparkle)

    Hello @sadik2303,

    I’m going to close this out for inactivity; please do not hesitate to reach out again if you need anything further.

    Thanks
    Elana D.

Viewing 6 replies - 1 through 6 (of 6 total)
  • You must be logged in to reply to this topic.