Пример #1
0
 public HttpResponseMessage GetUser()
 {
     try
     {
         FUser user = client.GetAuthenticatedUser(HttpContext.Current.Session["AccessToken"] as string);
         return(Request.CreateResponse <FUser>(HttpStatusCode.OK, user, "application/json"));
     }
     catch (InvalidOperationException ex)
     {
         return(Request.CreateResponse(HttpStatusCode.OK, new FUser(), "application/json"));
     }
 }
Пример #2
0
 public void GetAuthenticatedUser_WhenAccessTokenIsNull_ShouldThrowInvalidOperationException()
 {
     client.GetAuthenticatedUser(null);
 }