Skip to content

Commit 3008154

Browse files
committed
Merge tag '0.5.2' into develop
0.5.2
2 parents caf7f40 + 44e1356 commit 3008154

File tree

2 files changed

+17
-9
lines changed

2 files changed

+17
-9
lines changed

src/WebAppTest/Controllers/SampleIMAPController.cs

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,7 @@
88
using Microsoft.Extensions.Options;
99
using MimeKit;
1010
using Newtonsoft.Json;
11-
using Newtonsoft.Json.Linq;
1211
using System.IdentityModel.Tokens.Jwt;
13-
using System.Net.Mail;
1412
using System.Text;
1513
using WebAppTest.Controllers.Models;
1614

@@ -24,7 +22,7 @@ public class SampleIMAPController : Controller
2422
private readonly IOptionsMonitor<OAuth2Settings> _oauth2Settings;
2523
private readonly IHttpClientFactory _httpClientFactory;
2624

27-
private static Dictionary<string, SampleIMAPModel> InMemoryDb = new Dictionary<string, SampleIMAPModel>();
25+
private static Dictionary<string, SampleIMAPModel> InMemoryDb = new ();
2826

2927
public SampleIMAPController(
3028
CodeFlowHelper codeFlowHelper,
@@ -61,7 +59,7 @@ public async Task<IActionResult> CodeFlow()
6159

6260
// In a real world, this will return a redirect to the code challenge url so that
6361
// the user will be immediately prompted with a login page.
64-
var model = new SampleIMAPModel();
62+
var model = new ();
6563
model.State = customState;
6664
model.LoginLink = codeChallengeUrl.AbsoluteUri;
6765
model.DebugLoginLink = DumpUrl(model.LoginLink);
@@ -82,7 +80,7 @@ public async Task<IActionResult> ClientFlow(ClientFlowDto dto)
8280

8381
var model = new SampleIMAPModel();
8482
await DumpTokenRequest(request, model);
85-
83+
8684
var client = _httpClientFactory.CreateClient("default");
8785
var response = await client.SendAsync(request);
8886
if (!response.IsSuccessStatusCode)
@@ -227,7 +225,7 @@ public async Task<IActionResult> GetToken()
227225
return View("Index", model);
228226
}
229227

230-
private static async Task DumpTokenRequest(HttpRequestMessage request, SampleIMAPModel model)
228+
private static async Task DumpTokenRequest(HttpRequestMessage request, SampleIMAPModel model)
231229
{
232230
var content = await request.Content.ReadAsStringAsync();
233231
StringBuilder sb = new StringBuilder();
@@ -275,8 +273,8 @@ private async Task<IActionResult> TestImapConnection(SampleIMAPModel model)
275273
await ConnectToImap(model);
276274
return View("Index", model);
277275
}
278-
279-
private static async Task ConnectToImap(SampleIMAPModel model, string email = null)
276+
277+
private static async Task ConnectToImap(SampleIMAPModel model, string? email = null)
280278
{
281279
email ??= model.EmailAddress;
282280
var oauth2_1 = new SaslMechanismOAuth2(email, model.AccessToken);

src/WebAppTest/Views/SampleIMAP/Index.cshtml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
@*
22
For more information on enabling MVC for empty projects, visit https://go.microsoft.com/fwlink/?LinkID=397860
33
*@
4+
<style>
5+
pre {
6+
white-space: pre-wrap; /* Since CSS 2.1 */
7+
white-space: -moz-pre-wrap; /* For Mozilla */
8+
white-space: -pre-wrap; /* For Opera 4-6 */
9+
white-space: -o-pre-wrap; /* For Opera 7 */
10+
word-wrap: break-word; /* For Internet Explorer 5.5+ */
11+
max-width: 100%; /* Specify a max-width if necessary */
12+
}
13+
</style>
414
@model WebAppTest.Controllers.Models.SampleIMAPModel
515
@{
616
@if (String.IsNullOrEmpty(Model.AccessToken))
@@ -72,7 +82,7 @@
7282
<h3>Token Request</h3>
7383
<pre>@Model.RequestTokenData</pre>
7484
<h3>Id Token</h3>
75-
<pre>@Model.IdToken</pre>
85+
<pre >@Model.IdToken</pre>
7686
<h3>Access Token</h3>
7787
<pre>@Model.AccessToken</pre>
7888
<h3>RefreshToken Token</h3>

0 commit comments

Comments
 (0)