Skip to content

Commit c1d3c2c

Browse files
Update hub/apps/develop/security/oauth2.md
Co-authored-by: Copilot <[email protected]>
1 parent 66465b1 commit c1d3c2c

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

hub/apps/develop/security/oauth2.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,13 @@ if (TokenResponse tokenResponse = tokenRequestResult.Response())
200200
{
201201
// ExpiresIn is zero when not present
202202
DateTime expires = winrt::clock::now();
203-
if (String expiresIn = tokenResponse.ExpiresIn(); expiresIn != 0)
203+
if (String expiresInStr = tokenResponse.ExpiresIn(); !expiresInStr.empty())
204204
{
205-
expires += std::chrono::seconds(static_cast<int64_t>(expiresIn));
205+
int expiresIn = std::stoi(expiresInStr);
206+
if (expiresIn != 0)
207+
{
208+
expires += std::chrono::seconds(static_cast<int64_t>(expiresIn));
209+
}
206210
}
207211
else
208212
{

0 commit comments

Comments
 (0)