Skip to content
This repository has been archived by the owner on Dec 9, 2020. It is now read-only.

Display Sign-out message instead of throwing error response always #34

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion CSharp/BotAuth/Controllers/CallbackController.cs
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,17 @@ public class CallbackController : ApiController
[Route("Callback")]
public async Task<HttpResponseMessage> Callback()
{
return Request.CreateErrorResponse(HttpStatusCode.BadRequest, new Exception());
try
{
var resp = new HttpResponseMessage(HttpStatusCode.OK);
resp.Content = new StringContent($"<html><body>You have been signed out. You can now close this window.</body></html>", System.Text.Encoding.UTF8, @"text/html");
return resp;
}
catch (Exception ex)
{
// Callback is called with no pending message as a result the login flow cannot be resumed.
return Request.CreateErrorResponse(HttpStatusCode.BadRequest, ex);
}
}

[HttpGet]
Expand Down