Skip to content

Commit dfa7f3c

Browse files
committed
Address review feedback: add YARD @note for network/thread-safety, remove debug comment, assert return value in test
1 parent 17c9c55 commit dfa7f3c

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

lib/auth0/mixins/token_management.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,9 @@ module TokenManagement
44

55
# Get the Client's api token (or generate a new one if it has expired).
66
#
7+
# @note This method may perform a network request to refresh an expired token. It is not thread-safe.
78
# @return [String] the api token
89
def get_token
9-
# pp @token_expires_at
1010
has_expired = @token && @token_expires_at ? @token_expires_at < (Time.now.to_i + 10) : false
1111

1212
if (@token.nil? || has_expired) && @client_id && (@client_secret || @client_assertion_signing_key)

spec/lib/auth0/mixins/token_management_spec.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -130,7 +130,7 @@
130130

131131
expect(RestClient::Request).not_to receive(:execute)
132132

133-
instance.get_token
133+
expect(instance.get_token).to eq('test-token')
134134
end
135135
end
136136
end

0 commit comments

Comments
 (0)