We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 17c9c55 commit dfa7f3cCopy full SHA for dfa7f3c
2 files changed
lib/auth0/mixins/token_management.rb
@@ -4,9 +4,9 @@ module TokenManagement
4
5
# Get the Client's api token (or generate a new one if it has expired).
6
#
7
+ # @note This method may perform a network request to refresh an expired token. It is not thread-safe.
8
# @return [String] the api token
9
def get_token
- # pp @token_expires_at
10
has_expired = @token && @token_expires_at ? @token_expires_at < (Time.now.to_i + 10) : false
11
12
if (@token.nil? || has_expired) && @client_id && (@client_secret || @client_assertion_signing_key)
spec/lib/auth0/mixins/token_management_spec.rb
@@ -130,7 +130,7 @@
130
131
expect(RestClient::Request).not_to receive(:execute)
132
133
- instance.get_token
+ expect(instance.get_token).to eq('test-token')
134
end
135
136
0 commit comments