OctoPrint.browser

OctoPrint.browser.login(username, password, remember, opts)

Logs the browser into OctoPrint, using the provided username and password as credentials. If remember is set to true, the session will also persist across browser restarts.

Example:

OctoPrint.browser.login("myusername", "mypassword", true)
    .done(function(response) {
        // do something with the response
    });
Arguments:
  • username (string) – Username to log in with
  • password (string) – Password to log in with
  • remember (bool) – “Remember me”
  • opts (object) – Additional request options
Returns Promise:
 

A jQuery Promise for the request’s response

OctoPrint.browser.passiveLogin(opts)

Tries to perform a passive login into OctoPrint, using existing session data stored in the browser’s cookies.

Arguments:
  • opts (object) – Additional request options
Returns Promise:
 

A jQuery Promise for the request’s response

OctoPrint.browser.logout(opts)

Logs the browser out of OctoPrint.

Arguments:
  • opts (object) – Additional request options
Returns Promise:
 

A jQuery Promise for the request’s response