                 
                 user = login.find('input[name=user]')    
                 pass = login.find('input[name=pass]')
-                                            
+                
+                div = login.find('> div')
+                
                 login.on 'submit', ()=>
                     
                     if @identity.login()

                        user = @identity.login()
                        
                        if !user
                            input name:'user', value:'', placeholder: @data.strings.user
                                                                        
                            input name:'pass', value:'', type:'password', placeholder:@data.strings.pass
                        
                        button type: 'submit', name:'button', ->
                            if user then @data.strings.logout else @data.strings.login

                        @_getAuthManager().logout (err)=> location.reload()                                        
                        
                    else            
                        if div.is ':visible'                            
                            @_getAuthManager().login user.val(), pass.val(), (err)=>                                    
                                if err
                                    pass.val ''
                                    hint.addClass('error').text(err.message)
                             
                                else
                                    location.reload()
                        
                        else div.show()
                        
                    return false
                
                done()
