Add support for phantomjs secret

This commit is contained in:
Hillel Coren 2017-02-15 22:58:27 +02:00
parent 05886a5ed1
commit 9c6b9fc439
2 changed files with 5 additions and 1 deletions

View File

@ -80,6 +80,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

@ -1221,7 +1221,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');