logo

mastofe

My custom branche(s) on git.pleroma.social/pleroma/mastofe
commit: 71bc75e6ac00050ff98609b3cbeb38a0db157e1f
parent: e4fee6c138b7fdab3820e9cf6406b1d5195269e8
Author: Eugen Rochko <eugen@zeonfederated.com>
Date:   Wed, 28 Jun 2017 17:43:48 +0200

Do not fail to create access token if superapp was never created (#3986)


Diffstat:

Mapp/models/session_activation.rb4+---
1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/app/models/session_activation.rb b/app/models/session_activation.rb @@ -69,9 +69,7 @@ class SessionActivation < ApplicationRecord def assign_access_token superapp = Doorkeeper::Application.find_by(superapp: true) - return if superapp.nil? - - self.access_token = Doorkeeper::AccessToken.create!(application_id: superapp.id, + self.access_token = Doorkeeper::AccessToken.create!(application_id: superapp&.id, resource_owner_id: user_id, scopes: 'read write follow', expires_in: Doorkeeper.configuration.access_token_expires_in,