Closed vumaasha closed 11 years ago
Hi there! My first guess would be that you're not returning a user JSON object from the login action server-side. The client expects the server to tell it who the new user is when a login is performed, so you have to include the (non-sensitive, e.g. username + role) user data of the newly logged in user in the HTTP Response. If you inspect a login XHR in Chrome Dev Tools or Firebug you will see what the expected response should look like :)
Let me know if this works or not!
Perfect guess. It was the reason. Found that Auth.isLoggedIn() is responsible for checking the login status, after patiently reading your blog post one more time and this helped to fix the issue. Thanks a lot for your support.
I just modified the local strategy to support database backing, Users.find gets the user and the inside the callback, I moved the corresponding code. After I moved this, When i login, the home screen does not come. If i refresh the screen, then it home screen appears. I am not sure if it is a client side or server side issue. I am new to node and any suggestions on how to debug will also be very helpful.
The Users objects is sequelize orm mapping for the table that stores user info.