Allow ping with api_secret or account token

This commit is contained in:
Hillel Coren 2017-03-05 12:30:08 +02:00
parent 301c36809c
commit 675f899744

View File

@ -54,6 +54,8 @@ class ApiCheck
if ($token && $token->user) {
Auth::onceUsingId($token->user_id);
Session::set('token_id', $token->id);
} elseif ($hasApiSecret && $request->is('api/v1/ping')) {
// do nothing: allow ping with api_secret or account token
} else {
sleep(ERROR_DELAY);
$error['error'] = ['message' => 'Invalid token'];