mirror of
https://github.com/Jermolene/TiddlyWiki5
synced 2025-10-29 06:37:39 +00:00
Add password handling to server
This commit is contained in:
36
core/modules/commands/password.js
Normal file
36
core/modules/commands/password.js
Normal file
@@ -0,0 +1,36 @@
|
||||
/*\
|
||||
title: $:/core/modules/commands/password.js
|
||||
type: application/javascript
|
||||
module-type: command
|
||||
|
||||
Save password for crypto operations
|
||||
|
||||
\*/
|
||||
(function(){
|
||||
|
||||
/*jslint node: true, browser: true */
|
||||
/*global $tw: false */
|
||||
"use strict";
|
||||
|
||||
exports.info = {
|
||||
name: "password",
|
||||
synchronous: true
|
||||
};
|
||||
|
||||
var Command = function(params,commander,callback) {
|
||||
this.params = params;
|
||||
this.commander = commander;
|
||||
this.callback = callback;
|
||||
};
|
||||
|
||||
Command.prototype.execute = function() {
|
||||
if(this.params.length < 1) {
|
||||
return "Missing password";
|
||||
}
|
||||
$tw.crypto.setPassword(this.params[0]);
|
||||
return null;
|
||||
};
|
||||
|
||||
exports.Command = Command;
|
||||
|
||||
})();
|
||||
Reference in New Issue
Block a user