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

HTTP password input field should not allow longer than 16 characters #61

Open
glynhudson opened this issue Jun 12, 2019 · 1 comment
Open
Labels

Comments

@glynhudson
Copy link
Member

Password is currently limited to 16 characters but it is possible for a user to enter a longer password which results in silent failure then user is unable to login since password in truncated.This could be fixed by a hard limit on the password input field.

https://community.openenergymonitor.org/t/reset-http-auth-password-on-esp8266/11159

@glynhudson glynhudson added the bug label Jun 12, 2019
@glynhudson glynhudson changed the title HTTP password input field should not allow longet than 16 characters HTTP password input field should not allow longer than 16 characters Jun 12, 2019
@CircuitSetup
Copy link

Fixed this in config.js under the admin save event:

self.saveAdminFetching = ko.observable(false);
self.saveAdminSuccess = ko.observable(false);
self.saveAdmin = function () {
  var adminsave = {
  	user: self.config.www_username(),
  	pass: self.config.www_password()
  };
  
  if (adminsave.user.length > 16 || adminsave.pass.length > 16) {
  	alert("Please enter a username and password that is 16 characters or less");
  } else {
  self.saveAdminFetching(true);
  self.saveAdminSuccess(false);
  $.post(baseEndpoint + "/saveadmin", adminsave, function (data) {
    self.saveAdminSuccess(true);
  }).fail(function () {
    alert("Failed to save Admin config");
  }).always(function () {
    self.saveAdminFetching(false);
  });
 }
};

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

No branches or pull requests

2 participants