SHARE
TWEET

Untitled

a guest Apr 10th, 2019 119 in 169 days
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. _          = require 'lodash'
  2. $          = require 'jquery'
  3. routes     = require './../../../../routes'
  4.  
  5. login =
  6.  events:
  7.   submit: (e) ->
  8.    e.preventDefault()
  9.    await $.post "#{routes.auth.path}?#{$(e.target).serialize()}", defer res...
  10.    location.replace unless res[0].redirectTo is 'undefined'
  11.                       res[0].redirectTo
  12.                     else routes.home
  13.    
  14.  init: ->
  15.   $(document).off 'submit', 'form#auth-form'
  16.   $(document).on('submit', 'form#auth-form',_.bind(@events.submit, @))
  17.  
  18. module.exports = login
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top