MCPcopy Index your code
hub / github.com/writefreely/writefreely / handleOAuthError

Method handleOAuthError

handle.go:903–920  ·  view source on GitHub ↗
(w http.ResponseWriter, r *http.Request, err error)

Source from the content-addressed store, hash-verified

901}
902
903func (h *Handler) handleOAuthError(w http.ResponseWriter, r *http.Request, err error) {
904 if err == nil {
905 return
906 }
907
908 if err, ok := err.(impart.HTTPError); ok {
909 if err.Status >= 300 && err.Status < 400 {
910 sendRedirect(w, err.Status, err.Message)
911 return
912 }
913
914 impart.WriteOAuthError(w, err)
915 return
916 }
917
918 impart.WriteOAuthError(w, impart.HTTPError{http.StatusInternalServerError, "This is an unhelpful error message for a miscellaneous internal error."})
919 return
920}
921
922func correctPageFromLoginAttempt(r *http.Request) string {
923 to := r.FormValue("to")

Callers 1

OAuthMethod · 0.95

Calls 1

sendRedirectFunction · 0.85

Tested by

no test coverage detected