diff options
author | Andrew Arnott <andrewarnott@gmail.com> | 2013-03-02 09:25:24 -0800 |
---|---|---|
committer | Andrew Arnott <andrewarnott@gmail.com> | 2013-03-02 09:25:24 -0800 |
commit | cd7bed180abfe36ba4ae778d70cd7976de55907d (patch) | |
tree | 27c94ba5cede9387c2abafff97c817ab575313ad /samples/OAuthConsumer/Twitter.aspx.cs | |
parent | 1a1a37ebb26034d2f5470c3be2da18cefe5293da (diff) | |
download | DotNetOpenAuth-cd7bed180abfe36ba4ae778d70cd7976de55907d.zip DotNetOpenAuth-cd7bed180abfe36ba4ae778d70cd7976de55907d.tar.gz DotNetOpenAuth-cd7bed180abfe36ba4ae778d70cd7976de55907d.tar.bz2 |
Fixes some recent regressions to get twitter.aspx working.
Diffstat (limited to 'samples/OAuthConsumer/Twitter.aspx.cs')
-rw-r--r-- | samples/OAuthConsumer/Twitter.aspx.cs | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/samples/OAuthConsumer/Twitter.aspx.cs b/samples/OAuthConsumer/Twitter.aspx.cs index e107928..f9df3b2 100644 --- a/samples/OAuthConsumer/Twitter.aspx.cs +++ b/samples/OAuthConsumer/Twitter.aspx.cs @@ -3,6 +3,7 @@ using System.Collections.Generic; using System.Configuration; using System.Linq; + using System.Net; using System.Text; using System.Web; using System.Web.UI; @@ -15,7 +16,7 @@ public partial class Twitter : System.Web.UI.Page { private AccessToken AccessToken { - get { return (AccessToken)Session["TwitterAccessToken"]; } + get { return (AccessToken)(Session["TwitterAccessToken"] ?? new AccessToken()); } set { Session["TwitterAccessToken"] = value; } } @@ -33,6 +34,7 @@ // If we don't yet have access, immediately request it. Uri redirectUrl = await twitter.RequestUserAuthorizationAsync(MessagingUtilities.GetPublicFacingUrl()); this.Response.RedirectLocation = redirectUrl.AbsoluteUri; + this.Response.StatusCode = (int)HttpStatusCode.Redirect; } } } |