简体   繁体   中英

Doorkeeper 5.4.0 ArgumentError

I recently updated my app, from doorkeeper 5.3.3 to 5.4.0 but changes to Doorkeeper::AccessToken.find_or_create_for were made apparently, but I can't find anything in the CHANGELOG

so

@access_token = Doorkeeper::AccessToken.find_or_create_for(
  oauth_client,
  model.user.id,
  oauth_scopes,
  oauth_expiry_time,
  oauth_server.refresh_token_enabled?
)

returns now an ArgumentError

ArgumentError (wrong number of arguments (given 5, expected 0; required keywords: application, resource_owner, scopes)):

Has this also happened to anybody else?

Doorkeeper::AccessToken.find_or_create_for seems to expects keyword arguments instead of a simple list of arguments nowadays.

@access_token = Doorkeeper::AccessToken.find_or_create_for(
  application:       oauth_client,
  resource_owner:    model.user.id,
  scopes:            oauth_scopes,
  expires_in:        oauth_expiry_time,
  use_refresh_token: oauth_server.refresh_token_enabled?
)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2025 STACKOOM.COM