chaplinjs / chaplin

HTML5 application architecture using Backbone.js
http://chaplinjs.org
Other
2.85k stars 232 forks source link

Logout doesn't work #15

Closed paulmillr closed 12 years ago

paulmillr commented 12 years ago

And the cause is this https://github.com/moviepilot/chaplin/blob/master/coffee/views/application_view.coffee#L182 function

On L198 there's controllerName but it's undefined variable.

paulmillr commented 12 years ago

by the way, could you please post some recomentations for how to make logout?

molily commented 12 years ago

I fixed the reference to the non-existing variable, but I don’t understand how this impairs the logout process.

In general, the logout process is triggered by fireing the !logout event. The SessionController listens for this event, disposes the users, resets some state variables and shows the login view again. The difference between the !logout and logout event is that there can be some I/O action between them. For example, on moviepilot.com, we’re destroying the session on the server and if that suceeds, logout is triggered (which means logout successful).

molily commented 12 years ago

Also, changing the controllerName to @currentControllerName will not prevent the code from from throwing an exception. ;) Every controller should have a historyURL property or method. If it doesn’t, an exception will be thrown in the adjustURL method.

paulmillr commented 12 years ago

cool, thanks