📝 Add some more examples for socket auth

Also fix a problem with a config example's markup
This commit is contained in:
Gina Häußge committed 2021-02-16 17:10:50 +01:00
1 parent 85a6144de9
commit 47eeb0eb00
3 files changed
+46

No files matched your search

+19
View File
@@ -29,6 +29,25 @@
Tries to perform a passive login into OctoPrint, using existing session data
stored in the browser's cookies.
.. code-block:: javascript
OctoPrint.browser.passiveLogin()
.done(function(response) {
// do something with the response
})
.. code-block:: javascript
var client = new OctoPrintClient({
baseurl: "https://example.com/",
apikey: "..."
});
client.browser.passiveLogin()
.done(function(response) {
// do something with the response, e.g. authenticate with the socket
// via response.name and response.session
})
:param object opts: Additional request options
:returns Promise: A `jQuery Promise <http://api.jquery.com/Types/#Promise>`_ for the request's response