remove one indirection

This commit is contained in:
simon lehericey 2024-03-18 17:36:25 +01:00
parent ee4af30725
commit 4997a81639
2 changed files with 3 additions and 11 deletions

View file

@ -1,9 +0,0 @@
class AgentConnectClient < OpenIDConnect::Client
def initialize(code = nil)
super(AGENT_CONNECT)
if code.present?
self.authorization_code = code
end
end
end

View file

@ -6,7 +6,7 @@ class AgentConnectService
end
def self.authorization_uri
client = AgentConnectClient.new
client = OpenIDConnect::Client.new(AGENT_CONNECT)
state = SecureRandom.hex(16)
nonce = SecureRandom.hex(16)
@ -22,7 +22,8 @@ class AgentConnectService
end
def self.user_info(code, nonce)
client = AgentConnectClient.new(code)
client = OpenIDConnect::Client.new(AGENT_CONNECT)
client.authorization_code = code
access_token = client.access_token!(client_auth_method: :secret)