Browse Source

Show cookies error message on forbidden response

James Allen 11 years ago
parent
commit
ae3175c805
1 changed files with 8 additions and 3 deletions
  1. 8 3
      services/web/public/coffee/directives/asyncForm.coffee

+ 8 - 3
services/web/public/coffee/directives/asyncForm.coffee

@@ -42,9 +42,14 @@ define [
 							scope[attrs.name].inflight = false
 							response.success = false
 							response.error = true
-							response.message =
-								text: data.message?.text or data.message or "Something went wrong talking to the server :(. Please try again."
-								type: 'error'
+							if status == 403 # Forbidden
+								response.message =
+									text: "Session error. Please check you have cookies enabled. If the problem persists, try clearing your cache and cookies."
+									type: "error"
+							else
+								response.message =
+									text: data.message?.text or data.message or "Something went wrong talking to the server :(. Please try again."
+									type: 'error'
 							ga('send', 'event', formName, 'failure', data.message)
 		}