Skip to content

Commit

Permalink
Fixed NullReferenceException when ASP.NET app, using OAuth2SessionSta…
Browse files Browse the repository at this point in the history
…teCredentialStore, doesn't include offline.access scope. (#331)
  • Loading branch information
JoeMayo authored Jun 29, 2022
1 parent cd5f69d commit 9377486
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 deletions.
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk.Web">

<PropertyGroup>
<TargetFramework>net5.0</TargetFramework>
<TargetFramework>net6.0</TargetFramework>
</PropertyGroup>

<ItemGroup>
Expand All @@ -10,10 +10,10 @@

<ItemGroup>
<Reference Include="LinqToTwitter">
<HintPath>..\..\..\..\..\src\LinqToTwitter6\LinqToTwitter.AspNet\bin\Debug\net5.0\LinqToTwitter.dll</HintPath>
<HintPath>..\..\..\..\..\src\LinqToTwitter6\LinqToTwitter.AspNet\bin\Debug\net6.0\LinqToTwitter.dll</HintPath>
</Reference>
<Reference Include="LinqToTwitter.AspNet">
<HintPath>..\..\..\..\..\src\LinqToTwitter6\LinqToTwitter.AspNet\bin\Debug\net5.0\LinqToTwitter.AspNet.dll</HintPath>
<HintPath>..\..\..\..\..\src\LinqToTwitter6\LinqToTwitter.AspNet\bin\Debug\net6.0\LinqToTwitter.AspNet.dll</HintPath>
</Reference>
</ItemGroup>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public override string ClientID
}
set
{
session.SetString("OAuth2ClientID", value);
session.SetString("OAuth2ClientID", value ?? string.Empty);
}
}

Expand All @@ -49,7 +49,7 @@ public override string ClientSecret
}
set
{
session.SetString("OAuth2ClientSecret", value);
session.SetString("OAuth2ClientSecret", value ?? string.Empty);
}
}

Expand All @@ -64,7 +64,7 @@ public override string CodeChallenge
}
set
{
session.SetString("OAuth2CodeChallenge", value);
session.SetString("OAuth2CodeChallenge", value ?? string.Empty);
}
}

Expand Down Expand Up @@ -103,7 +103,7 @@ public override string AccessToken
}
set
{
session.SetString("OAuth2AccessToken", value);
session.SetString("OAuth2AccessToken", value ?? string.Empty);
}
}

Expand All @@ -118,7 +118,7 @@ public override string RefreshToken
}
set
{
session.SetString("OAuth2RefreshToken", (string)value);
session.SetString("OAuth2RefreshToken", value ?? string.Empty);
}
}

Expand All @@ -133,7 +133,7 @@ public override string RedirectUri
}
set
{
session.SetString("OAuth2Callback", value);
session.SetString("OAuth2Callback", value ?? string.Empty);
}
}

Expand All @@ -149,7 +149,7 @@ public override string State
}
set
{
session.SetString("OAuth2State", value);
session.SetString("OAuth2State", value ?? string.Empty);
}
}

Expand Down

0 comments on commit 9377486

Please sign in to comment.