Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not login in #20

Closed
forzaz opened this issue Apr 10, 2018 · 2 comments
Closed

Does not login in #20

forzaz opened this issue Apr 10, 2018 · 2 comments

Comments

@forzaz
Copy link
Owner

forzaz commented Apr 10, 2018

I had to change the following code in autorizeUser in authorization.js in order to login in:

from:
RetrieveMessages(function(){
if(data[2] === "1")
{
this is a temporary password, let the user change it.
view.router.loadPage('resetpassword.html');
} else {
storage.setItem("login","true");
view.router.loadPage('menu.html');
}
});

to:
RetrieveMessages();
if (data[2] === "1") {
//this is a temporary password, let the user change it.
view.router.loadPage('resetpassword.html');
} else {
storage.setItem("login","true");
view.router.loadPage('menu.html');
}

I am not sure where went wrong and why in this case you used the page-turning part as input to RetrieveMessages function.

@mmamarmarc
Copy link
Collaborator

Did you update the database with the new 'messages' table?
The reason it is like the first block of code is to make sure the information collection from the database happens before we allow the user to take other actions.
In how you changed it now, the message will be retrieved at the same time as that you send the user to the menu page. If the user is fast and the message retrieval slow, this might cause problems if the user, for example, instantly goes to the messages page.

@forzaz
Copy link
Owner Author

forzaz commented Apr 17, 2018

Thanks for the explanation. Now I understand why you wrote it that way.

I updated the database with the new 'message' table. Have you tried yourself that login in is normal when you use the original code?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants