From 8198574087cde0fe848c6456cc3160a833cb3d00 Mon Sep 17 00:00:00 2001 From: Jeremy Ruston Date: Sun, 24 Mar 2024 21:15:31 +0000 Subject: [PATCH] Remove code that is unneeded for the moment --- .../multiwikiclient/multiwikiclientadaptor.js | 64 ------------------- 1 file changed, 64 deletions(-) diff --git a/plugins/tiddlywiki/multiwikiclient/multiwikiclientadaptor.js b/plugins/tiddlywiki/multiwikiclient/multiwikiclientadaptor.js index 45f551c30..fbb86bd38 100644 --- a/plugins/tiddlywiki/multiwikiclient/multiwikiclientadaptor.js +++ b/plugins/tiddlywiki/multiwikiclient/multiwikiclientadaptor.js @@ -103,70 +103,6 @@ MultiWikiClientAdaptor.prototype.getStatus = function(callback) { } }; -/* -Attempt to login and invoke the callback(err) -*/ -MultiWikiClientAdaptor.prototype.login = function(username,password,callback) { - var options = { - url: this.host + "challenge/tiddlywebplugins.tiddlyspace.cookie_form", - type: "POST", - data: { - user: username, - password: password, - tiddlyweb_redirect: "/status" // workaround to marginalize automatic subsequent GET - }, - callback: function(err) { - callback(err); - }, - headers: { - "accept": "application/json", - "X-Requested-With": "TiddlyWiki" - } - }; - this.logger.log("Logging in:",options); - $tw.utils.httpRequest(options); -}; - -/* -*/ -MultiWikiClientAdaptor.prototype.logout = function(callback) { - if(this.logoutIsAvailable) { - var options = { - url: this.host + "logout", - type: "POST", - data: { - csrf_token: this.getCsrfToken(), - tiddlyweb_redirect: "/status" // workaround to marginalize automatic subsequent GET - }, - callback: function(err,data,xhr) { - callback(err); - }, - headers: { - "accept": "application/json", - "X-Requested-With": "TiddlyWiki" - } - }; - this.logger.log("Logging out:",options); - $tw.utils.httpRequest(options); - } else { - alert("This server does not support logging out. If you are using basic authentication the only way to logout is close all browser windows"); - callback(null); - } -}; - -/* -Retrieve the CSRF token from its cookie -*/ -MultiWikiClientAdaptor.prototype.getCsrfToken = function() { - var regex = /^(?:.*; )?csrf_token=([^(;|$)]*)(?:;|$)/, - match = regex.exec(document.cookie), - csrf = null; - if (match && (match.length === 2)) { - csrf = match[1]; - } - return csrf; -}; - /* Get details of changed tiddlers from the server */