Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Fix ajax error callback function
  • Loading branch information
reyesyang committed Dec 18, 2013
1 parent 4a91c01 commit a618020
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions app/assets/javascripts/persona.js.coffee
Expand Up @@ -3,7 +3,7 @@ $ () ->
$logout_button = $("#logout-button")

navigator.id.watch
loggedInUser: ($.cookie('email') || null)
loggedInUser: $.cookie('email') || null
onlogin: (assertion) ->
$.ajax
type: 'POST'
Expand All @@ -13,17 +13,17 @@ $ () ->
}
success: (res, status, xhr) ->
window.location.reload()
error: (res, status, xhr) ->
alert("Signin Failed!")
error: (xhr, status, error) ->
alert("Login Failed!")

onlogout: () ->
$.ajax
type: 'DELETE',
url: '/logout.json',
success: (res, status, xhr) ->
window.location.reload()
error: (res, status, xhr) ->
alert("Signout Failed")
error: (xhr, status, error) ->
alert("Logout Failed")

$login_button.on "click", (e) ->
e.preventDefault()
Expand Down

0 comments on commit a618020

Please sign in to comment.