summaryrefslogtreecommitdiff
path: root/public/assets/js/lib/views/login/login.js
blob: a48b404d13b24813809adf9c250996f21da588bd (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
26
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){
  console.log(data)
    if (data.returnTo) {
      window.location.href = "/index"
    }
    else {
      window.location.href = "/index"
    }
  },

})