summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/views/login/login.js
blob: 90c1b67de84fbe7335a627d413a6a8da5aff879e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
var LoginView = FormView.extend({
  
  el: "#login",
  action: "/api/login",
  method: "POST",
  
  initialize: function(opt){
    this.__super__.initialize.call(this)
    this.$("[name=username]").focus()
  },
  
  showErrors: function(errors){
    console.log(errors)
  },
  
  success: function(data){
    if (data.returnTo) {
      window.location.href = "/index"
    }
    else {
      window.location.href = "/index"
    }
  },

})