Fix settings application controller writing role
This commit is contained in:
parent
0341cd8572
commit
09ba5c9be8
@ -213,12 +213,14 @@ class User < ApplicationRecord
|
|||||||
|
|
||||||
def token_for_app(a)
|
def token_for_app(a)
|
||||||
return nil if a.nil? || a.owner != self
|
return nil if a.nil? || a.owner != self
|
||||||
Doorkeeper::AccessToken
|
ActiveRecord::Base.connected_to(role: :writing) do
|
||||||
.find_or_create_by(application_id: a.id, resource_owner_id: id) do |t|
|
Doorkeeper::AccessToken
|
||||||
|
.find_or_create_by(application_id: a.id, resource_owner_id: id) do |t|
|
||||||
|
|
||||||
t.scopes = a.scopes
|
t.scopes = a.scopes
|
||||||
t.expires_in = Doorkeeper.configuration.access_token_expires_in
|
t.expires_in = Doorkeeper.configuration.access_token_expires_in
|
||||||
t.use_refresh_token = Doorkeeper.configuration.refresh_token_enabled?
|
t.use_refresh_token = Doorkeeper.configuration.refresh_token_enabled?
|
||||||
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user