|
|
@ -28,6 +28,8 @@ class SessionActivation < ApplicationRecord
|
|
|
|
|
|
|
|
|
|
|
|
before_create :assign_access_token
|
|
|
|
before_create :assign_access_token
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
DEFAULT_SCOPES = %w(read write follow).freeze
|
|
|
|
|
|
|
|
|
|
|
|
class << self
|
|
|
|
class << self
|
|
|
|
def active?(id)
|
|
|
|
def active?(id)
|
|
|
|
id && exists?(session_id: id)
|
|
|
|
id && exists?(session_id: id)
|
|
|
@ -64,7 +66,7 @@ class SessionActivation < ApplicationRecord
|
|
|
|
{
|
|
|
|
{
|
|
|
|
application_id: Doorkeeper::Application.find_by(superapp: true)&.id,
|
|
|
|
application_id: Doorkeeper::Application.find_by(superapp: true)&.id,
|
|
|
|
resource_owner_id: user_id,
|
|
|
|
resource_owner_id: user_id,
|
|
|
|
scopes: 'read write follow',
|
|
|
|
scopes: DEFAULT_SCOPES.join(' '),
|
|
|
|
expires_in: Doorkeeper.configuration.access_token_expires_in,
|
|
|
|
expires_in: Doorkeeper.configuration.access_token_expires_in,
|
|
|
|
use_refresh_token: Doorkeeper.configuration.refresh_token_enabled?,
|
|
|
|
use_refresh_token: Doorkeeper.configuration.refresh_token_enabled?,
|
|
|
|
}
|
|
|
|
}
|
|
|
|