kennym / cf7-to-api

LOOKING FOR MAINTAINER. Wordpress plugin to transmit contact form 7 entries to remote API using POST or GET
https://wordpress.org/plugins/cf7-to-api-basic-auth/
52 stars 30 forks source link

Error line 595 of class-cf7-api-admin.php #9

Closed Daniel-E-Davies closed 4 years ago

Daniel-E-Davies commented 4 years ago

Typo says 'Basic ' instead of 'Bearer '

Secondly on the same line, the API key that I submit does not need to be base 64 encoded, it is already in the correct format. I hacked the line locally as follows. Not elegant but it works... For some reason removing the encoding all together created other errors.

$args['headers']['Authorization'] = 'Bearer ' . base64_decode(base64_encode( $bearer_auth ));

kennym commented 4 years ago

That's not a typo. This plugin already supports token authentication. It's almost on the same line.