Changed App.Auth to method mode.

This commit is contained in:
Martin Edenhofer 2012-07-15 17:16:18 +02:00
parent 99d1bfce00
commit bd0b29a200
5 changed files with 7 additions and 14 deletions

View file

@ -65,6 +65,5 @@ class App.SettingsAreaItem extends App.Controller
success: => success: =>
# login check # login check
auth = new App.Auth App.Auth.loginCheck()
auth.loginCheck()
) )

View file

@ -90,8 +90,7 @@ class Index extends App.Controller
if @master_user if @master_user
@master_user = false @master_user = false
auth = new App.Auth App.Auth.login(
auth.login(
data: { data: {
username: @params.login, username: @params.login,
password: @params.password, password: @params.password,
@ -113,8 +112,7 @@ class Index extends App.Controller
@log 'login:success', data @log 'login:success', data
# login check # login check
auth = new App.Auth App.Auth.loginCheck()
auth.loginCheck()
# add notify # add notify
Spine.trigger 'notify:removeall' Spine.trigger 'notify:removeall'

View file

@ -60,8 +60,7 @@ class Index extends App.Controller
@username = params['username'] @username = params['username']
# session create with login/password # session create with login/password
auth = new App.Auth App.Auth.login(
auth.login(
data: params, data: params,
success: @success success: @success
error: @error, error: @error,

View file

@ -10,8 +10,7 @@ class Index extends Spine.Controller
signout: -> signout: ->
# remove remote session # remove remote session
auth = new App.Auth App.Auth.logout()
auth.logout()
# remoce local session # remoce local session
@log 'Session', window.Session @log 'Session', window.Session

View file

@ -61,8 +61,7 @@ class Index extends App.Controller
# save user # save user
user.save( user.save(
success: (r) => success: (r) =>
auth = new App.Auth App.Auth.login(
auth.login(
data: { data: {
username: @params.login, username: @params.login,
password: @params.password, password: @params.password,
@ -77,8 +76,7 @@ class Index extends App.Controller
success: (data, status, xhr) => success: (data, status, xhr) =>
# login check # login check
auth = new App.Auth App.Auth.loginCheck()
auth.loginCheck()
# add notify # add notify
Spine.trigger 'notify:removeall' Spine.trigger 'notify:removeall'