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

Initialize loginUser and loginPass with an empty string #1175

Merged

Conversation

BillyBlaze
Copy link
Member

In this PR:

  1. Initialize loginUser and loginPass with an empty string
    If you login without entering any information then jQuery would succeed the failed AJAX request and tries to add the notification with "Login succes" but generates the following javascript error:

    Uncaught TypeError: Cannot read property 'name' of undefined
     $.ajax.success @ packed_app.js?35ab948d:1599
     l @ packed_libs.js?1bb5f6cd:3
     c.fireWith @ packed_libs.js?1bb5f6cd:3
     k @ packed_libs.js?1bb5f6cd:5
     (anonymous function) @ packed_libs.js?1bb5f6cd:5
    

    Strangely I noticed that the second post without entering information wouldn't trigger an error, I found out that was because during the post the observable where reset to an empty string. (so if we initialize with an empty string it wouldn't trigger the success function the first too)

  2. Clear loginUser and loginPass after a successful login
    A small usability thing, but very useful, I find it very annoying if I mistyped something to redo all the inputs, let the user control this. If this is to much for the maintenance branch then I can cherry pick this out ofcourse.

Clear loginUser and loginPass after a successful login (e.g. the user made a typo)
@foosel foosel merged commit 34ceb93 into OctoPrint:maintenance Jan 5, 2016
@BillyBlaze BillyBlaze deleted the maintenance_pnotify_undefined branch January 5, 2016 12:59
@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 29, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants