Skip to content

Commit

Permalink
Remove unnecessary token check
Browse files Browse the repository at this point in the history
  • Loading branch information
xin9le committed Sep 26, 2022
1 parent 3f7946d commit 3edb842
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/LitJWT/JwtDecoder.cs
Original file line number Diff line number Diff line change
Expand Up @@ -215,8 +215,6 @@ public DecodeResult TryDecode<T>(ReadOnlySpan<byte> utf8token, PayloadParser<T>
var reader = new System.Text.Json.Utf8JsonReader(decodedPayload);
while (reader.Read())
{
if (reader.TokenType == System.Text.Json.JsonTokenType.EndObject) break;

if (reader.CurrentDepth == 1 && reader.TokenType == JsonTokenType.PropertyName)
{
if (reader.ValueTextEquals(JwtConstantsUtf8.Expiration))
Expand Down Expand Up @@ -358,8 +356,6 @@ public DecodeResult TryDecode<T>(ReadOnlySpan<char> token, PayloadParser<T> payl
var reader = new System.Text.Json.Utf8JsonReader(decodedPayload);
while (reader.Read())
{
if (reader.TokenType == System.Text.Json.JsonTokenType.EndObject) break;

if (reader.CurrentDepth == 1 && reader.TokenType == JsonTokenType.PropertyName)
{
if (reader.ValueTextEquals(JwtConstantsUtf8.Expiration))
Expand Down Expand Up @@ -514,8 +510,6 @@ DecodeResult TryDecodeCore<T>(ReadOnlySpan<byte> utf8token, InternalPayloadParse
var reader = new System.Text.Json.Utf8JsonReader(decodedPayload);
while (reader.Read())
{
if (reader.TokenType == System.Text.Json.JsonTokenType.EndObject) break;

if (reader.CurrentDepth == 1 && reader.TokenType == JsonTokenType.PropertyName)
{
if (reader.ValueTextEquals(JwtConstantsUtf8.Expiration))
Expand Down Expand Up @@ -652,8 +646,6 @@ DecodeResult TryDecodeCore<T>(ReadOnlySpan<char> token, InternalPayloadParser<T>
var reader = new System.Text.Json.Utf8JsonReader(decodedPayload);
while (reader.Read())
{
if (reader.TokenType == System.Text.Json.JsonTokenType.EndObject) break;

if (reader.CurrentDepth == 1 && reader.TokenType == JsonTokenType.PropertyName)
{
if (reader.ValueTextEquals(JwtConstantsUtf8.Expiration))
Expand Down

0 comments on commit 3edb842

Please sign in to comment.