Skip to content

Commit

Permalink
modified CheckTokenStatus method
Browse files Browse the repository at this point in the history
  • Loading branch information
manjunathg88 committed Jan 11, 2024
1 parent c9a142b commit b0194e3
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions OAuthTokenGenerator/OAuthTokenGenerator.cs
Original file line number Diff line number Diff line change
@@ -42,14 +42,9 @@ public OAuthTokenGenerator(HttpClient httpClient)

public bool CheckTokenStatus(string accessToken)
{
bool tokenExpired = false;
var handler = new JwtSecurityTokenHandler();
var authTokenJWT = handler.ReadJwtToken(accessToken);
if (authTokenJWT?.ValidTo < DateTime.UtcNow)
{
tokenExpired = true;
}
return tokenExpired;
return authTokenJWT?.ValidTo < DateTime.UtcNow;
}
}
}

0 comments on commit b0194e3

Please sign in to comment.