Ember - Bind fail when going into login mode

When I first go to my url, the inputs are correctly bound to the properties of my controller.

Then logout and what it does is go to the login page.

When I try to login again it fails because the input values ​​arent bound to the controller, additionally I get this error:

Uncaught Error: Assertion Failed: Attempted to register a view with an id already in use: login 

      

If I refresh the page it works.

Some of my codes for links:

LoginRoute

export
default Ember.Route.extend({
    setupController: function(controller) {
        controller.reset();
    },

    beforeModel: function() {
        if (!Ember.isEmpty(this.controllerFor('sessions.login').get('token'))) {
            this.transitionTo('promotions');
        }
    }
});

      

LogoutRoute

export
default Ember.Route.extend({    
    beforeModel: function() {
        this.controllerFor('sessions.login').reset();
        this.transitionTo('sessions.login');
    }
});

      

LoginAction on Controller

    loginUser: function() {
        var _this = this;

        var login = this.get("login");
        var pass = this.get("password");

      

Login form

<form role="form" {{action 'loginUser' on='submit'}}>
                <div class="form-group">
                    {{input type="text" class="form-control" id="login" placeholder="Login" value=login autofocus="autofocus"}}
                    {{input type="password" class="form-control" id="password" placeholder="Password" value=password}}
                </div>
                <div class="form-group">
                    <span class="input-group-btn">
                        <button class="btn btn-default" type="submit" ><span>Entrar</span></button>
                    </span>
                </div>
            </form>

      

After testing a few more, I saw that the textFields are duplicated when I go to this page.

I really can't figure out why

+3
login ember.js


source to share


No one has answered this question yet

Check out similar questions:

3
Symfony 4, Login, how to debug "Invalid credentials" error?
1
How to combine both the login and registration page in Rails 3 using Devise?
1
Execute code after login Symfony2
1
Simple and efficient login mechanism using PHP and database
1
Send encrypted id / password from jsp form to controller
1
How to handle failed login with ZfcUser LoginWidget?
0
Admin login feature in CodeIgniter PHP not working
0
JQuery dialog and ajax input on form submit
0
CodeIgniter Login and Session
-3
I created admin login with PHP but it doesn't work. Can anyone walk me through it or suggest appropriate amendments?



All Articles
Loading...
X
Show
Funny
Dev
Pics