Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit fd4b95a

Browse files
Adding comment and renaming method
1 parent a05dc4d commit fd4b95a

File tree

3 files changed

+8
-3
lines changed

3 files changed

+8
-3
lines changed

src/GitHub.Api/IOAuthCallbackListener.cs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,10 @@ public interface IOAuthCallbackListener
1717
/// <returns>The temporary code included in the callback.</returns>
1818
Task<string> Listen(string id, CancellationToken cancel);
1919

20-
void RedirectCloseStop(Uri url);
20+
/// <summary>
21+
/// Redirects the last context to respond with listen and stops the underlying http listener
22+
/// </summary>
23+
/// <param name="url">Url to redirect to.</param>
24+
void RedirectLastContext(Uri url);
2125
}
2226
}

src/GitHub.Api/LoginManager.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ public async Task<LoginResult> LoginViaOAuth(
157157
await keychain.Save("[oauth]", token.AccessToken, hostAddress).ConfigureAwait(false);
158158
var result = await ReadUserWithRetry(client).ConfigureAwait(false);
159159
await keychain.Save(result.User.Login, token.AccessToken, hostAddress).ConfigureAwait(false);
160-
oauthListener.RedirectCloseStop(hostAddress.WebUri.Append(result.User.Login));
160+
oauthListener.RedirectLastContext(hostAddress.WebUri.Append(result.User.Login));
161161

162162
return result;
163163
}

src/GitHub.App/Services/OAuthCallbackListener.cs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
using System;
22
using System.ComponentModel.Composition;
3+
using System.Diagnostics;
34
using System.Net;
45
using System.Threading;
56
using System.Threading.Tasks;
@@ -70,7 +71,7 @@ public async Task<string> Listen(string id, CancellationToken cancel)
7071
}
7172
}
7273

73-
public void RedirectCloseStop(Uri url)
74+
public void RedirectLastContext(Uri url)
7475
{
7576
lastContext.Response.Redirect(url);
7677
lastContext.Response.Close();

0 commit comments

Comments
 (0)