Ejemplo n.º 1
0
 public ActionResult LogOut([FromBody] JWTTokenRequest request)
 {
     try
     {
         SessionManager _sessionManager = new SessionManager(new MongoClient(MONGODB_CONNECTION_STRING));
         return(_sessionManager.LogOut(request.JWTToken));
     }
     catch
     {
         return(new StatusCodeResult(StatusCodes.Status500InternalServerError));
     }
 }
Ejemplo n.º 2
0
 public HttpResponseMessage GetEmail([FromBody] JWTTokenRequest request)
 {
     try
     {
         UserManager userMan = new UserManager();
         var         result  = userMan.GetEmail(request.token);
         return(result);
     }
     catch (Exception e)
     {
         _gngLoggerService.LogBadRequest(_jwtService.GetUserIDFromToken(request.token).ToString(), "N/A", "https://www.greetngroup.com/user/", e.ToString());
         var httpResponseFail = new HttpResponseMessage(HttpStatusCode.InternalServerError)
         {
             Content = new StringContent("Unable to retrieve email")
         };
         return(httpResponseFail);
     }
 }