```ruby
Doorkeeper.configure do
  orm :active_record
  use_refresh_token
  api_only

  resource_owner_authenticator { current_spree_user }

  resource_owner_from_credentials do
    user = Spree.user_class.find_for_database_authentication(email: params[:username])
    user if user&.valid_for_authentication? { user.valid_password?(params[:password]) }
  end

  admin_authenticator do |routes|
    current_spree_user&.has_spree_role?('admin') || redirect_to(routes.root_url)
  end

  use_refresh_token

  grant_flows %w(password)

  access_token_methods :from_bearer_authorization, :from_access_token_param
end
```

Remove duplicate `use_refresh_token` in Doorkeeper initializer
user
```ruby
Doorkeeper.configure do
  orm :active_record
  use_refresh_token
  api_only

  resource_owner_authenticator { current_spree_user }

  resource_owner_from_credentials do
    user = Spree.user_class.find_for_database_authentication(email: params[:username])
    user if user&.valid_for_authentication? { user.valid_password?(params[:password]) }
  end

  admin_authenticator do |routes|
    current_spree_user&.has_spree_role?('admin') || redirect_to(routes.root_url)
  end

  grant_flows %w(password)

  access_token_methods :from_bearer_authorization, :from_access_token_param
end
```
assistant