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
14 changes: 14 additions & 0 deletions plugins/authentication/RestfulAuthenticationCookie.class.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,20 @@

class RestfulAuthenticationCookie extends RestfulAuthenticationBase implements RestfulAuthenticationInterface {

/**
* {@inheritdoc}
*/
public function applies(array $request = array(), $method = \RestfulInterface::GET) {
// Skip cookies auth if we have an access token.
if (variable_get('restful_prefer_access_token', FALSE) && isset($request['__application']['access_token'])) {
// The variable may be set if you want to be logged in both with a session
// cookie and with an access token, favoriting the access_token request
// see https://github.com/RESTful-Drupal/restful/issues/412.
return;
}
return TRUE;
}

/**
* Implements RestfulAuthenticationInterface::authenticate().
*/
Expand Down