Method: Justa::TokenManager.add_client
- Defined in:
- lib/justa/token_manager.rb
.add_client(client) ⇒ Array
Registers a new client to be used
89 90 91 92 93 94 95 96 97 98 |
# File 'lib/justa/token_manager.rb', line 89 def self.add_client(client) instance unless @instance client = (client.is_a? Justa::Client) ? client : Justa::Client.new(**client) raise ParamError.new("Client key '#{client.key}' already exists", "Key", "") if client_for client.key @instance.mutex.synchronize do @instance.authenticators << Authenticator.new(client) end end |