HandleGetSession handles the `GET /sessions/:id` request and responds with the session object in JSON format.
(c web.C, w http.ResponseWriter, r *http.Request)
| 164 | // HandleGetSession handles the `GET /sessions/:id` request and responds with the session |
| 165 | // object in JSON format. |
| 166 | func (s *Server) HandleGetSession(c web.C, w http.ResponseWriter, r *http.Request) { |
| 167 | session := saml.Session{} |
| 168 | err := s.Store.Get(fmt.Sprintf("/sessions/%s", c.URLParams["id"]), &session) |
| 169 | if err != nil { |
| 170 | http.Error(w, http.StatusText(http.StatusInternalServerError), http.StatusInternalServerError) |
| 171 | return |
| 172 | } |
| 173 | json.NewEncoder(w).Encode(session) |
| 174 | } |
| 175 | |
| 176 | // HandleDeleteSession handles the `DELETE /sessions/:id` request. It invalidates the |
| 177 | // specified session. |