Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,13 @@ public static function controllersInfo() {
public function getOrCreateToken() {
$entity_type = $this->getEntityType();
$account = $this->getAccount();

if (!$account->uid) {
// If this handler was called programmatically we want to make sure the
// account is of an authenticated user.
throw new RestfulBadRequestException('Only authenticated users can have an access token.');
}

// Check if there is a token that did not expire yet.
$query = new EntityFieldQuery();
$result = $query
Expand Down