1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-09-20 08:21:34 +02:00

Add support for phantomjs secret

This commit is contained in:
Hillel Coren 2017-02-15 22:59:23 +02:00
parent d92b177831
commit 2ad7c609d9
2 changed files with 5 additions and 1 deletions

View File

@ -77,6 +77,10 @@ class Authenticate
if (!$authenticated && $contact && !$contact->password) {
$authenticated = true;
}
if (env('PHANTOMJS_SECRET') && $request->phantomjs_secret && hash_equals(env('PHANTOMJS_SECRET'), $request->phantomjs_secret)) {
$authenticated = true;
}
}
if (!$authenticated) {

View File

@ -1203,7 +1203,7 @@ class Invoice extends EntityModel implements BalanceAffecting
try {
if (env('PHANTOMJS_BIN_PATH')) {
$pdfString = CurlUtils::phantom('GET', $link . '?phantomjs=true');
$pdfString = CurlUtils::phantom('GET', $link . '?phantomjs=true&phantomjs_secret=' . env('PHANTOMJS_SECRET'));
} elseif ($key = env('PHANTOMJS_CLOUD_KEY')) {
if (Utils::isNinjaDev()) {
$link = env('TEST_LINK');