Class: Masks::Rails::OpenID::Authorization

Inherits:
ApplicationRecord show all
Defined in:
app/models/masks/rails/openid/authorization.rb

Instance Method Summary collapse

Instance Method Details

#access_tokenObject



27
28
29
30
# File 'app/models/masks/rails/openid/authorization.rb', line 27

def access_token
  @access_token ||=
    update_attribute!(:expires_at, Time.now) && generate_access_token!
end

#generate_access_token!Object



32
33
34
# File 'app/models/masks/rails/openid/authorization.rb', line 32

def generate_access_token!
  actor.openid_access_tokens.create!(openid_client:, scopes:)
end

#valid_redirect_uri?(uri) ⇒ Boolean

Returns:

  • (Boolean)


23
24
25
# File 'app/models/masks/rails/openid/authorization.rb', line 23

def valid_redirect_uri?(uri)
  uri == redirect_uri
end