Skip to content

Commit fec24f0

Browse files
Change copy constructor to default in TokenResult (#611)
* Change copy constructor to default in TokenResult because it was the same. * Fixed functional tests for AutoRefreshingToken. Resolves: OLPEDGE-1494, OLPEDGE-837 Signed-off-by: Serhii Lozynskyi <[email protected]>
1 parent 919bd4b commit fec24f0

File tree

3 files changed

+4
-20
lines changed

3 files changed

+4
-20
lines changed

olp-cpp-sdk-authentication/include/olp/authentication/TokenResult.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -67,16 +67,6 @@ class AUTHENTICATION_API TokenResult {
6767
*/
6868
TokenResult() = default;
6969

70-
/**
71-
* @brief Creates the `TokenResult` instance that is a copy
72-
* of the `other` token result.
73-
*
74-
* @param other The `TokenResult` instance from which the access
75-
* key ID, access key secret, expiry time, HTTP status code, and error
76-
* description are copied.
77-
*/
78-
TokenResult(const TokenResult& other);
79-
8070
/**
8171
* @brief Gets the access token issued by the authorization server.
8272
*

olp-cpp-sdk-authentication/src/SignInResultImpl.cpp

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -70,11 +70,12 @@ SignInResultImpl::SignInResultImpl(
7070
token_type_ = (*json_document)[kTokenType].GetString();
7171
if (json_document->HasMember(Constants::REFRESH_TOKEN))
7272
refresh_token_ = (*json_document)[Constants::REFRESH_TOKEN].GetString();
73-
if (json_document->HasMember(Constants::EXPIRES_IN))
73+
if (json_document->HasMember(Constants::EXPIRES_IN)) {
7474
expiry_time_ = std::time(nullptr) +
7575
(*json_document)[Constants::EXPIRES_IN].GetUint();
76-
expires_in_ = std::chrono::seconds(
77-
(*json_document)[Constants::EXPIRES_IN].GetUint());
76+
expires_in_ = std::chrono::seconds(
77+
(*json_document)[Constants::EXPIRES_IN].GetUint());
78+
}
7879
if (json_document->HasMember(kUserId))
7980
user_identifier_ = (*json_document)[kUserId].GetString();
8081
if (json_document->HasMember(kScope))

olp-cpp-sdk-authentication/src/TokenResult.cpp

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -44,13 +44,6 @@ TokenResult::TokenResult(std::string access_token,
4444
expiry_time_ = std::time(nullptr) + expires_in_.count();
4545
}
4646

47-
TokenResult::TokenResult(const TokenResult& other) {
48-
this->access_token_ = other.access_token_;
49-
this->expiry_time_ = other.expiry_time_;
50-
this->http_status_ = other.http_status_;
51-
this->error_ = other.error_;
52-
}
53-
5447
const std::string& TokenResult::GetAccessToken() const { return access_token_; }
5548

5649
time_t TokenResult::GetExpiryTime() const { return expiry_time_; }

0 commit comments

Comments
 (0)