1
0
mirror of https://github.com/Jermolene/TiddlyWiki5 synced 2025-10-29 14:47:40 +00:00

Syncer: Allow syncadaptor to customise the login prompt

This commit is contained in:
jeremy@jermolene.com
2020-10-14 12:41:51 +01:00
parent 651fb777ab
commit 69c12618d9
2 changed files with 31 additions and 2 deletions

View File

@@ -400,7 +400,7 @@ Syncer.prototype.handleLoginEvent = function() {
var self = this;
this.getStatus(function(err,isLoggedIn,username) {
if(!err && !isLoggedIn) {
$tw.passwordPrompt.createPrompt({
var promptInfo = $tw.passwordPrompt.createPrompt({
serviceName: $tw.language.getString("LoginToTiddlySpace"),
callback: function(data) {
self.login(data.username,data.password,function(err,isLoggedIn) {
@@ -409,6 +409,10 @@ Syncer.prototype.handleLoginEvent = function() {
return true; // Get rid of the password prompt
}
});
// Let the sync adaptor adjust the prompt
if(self.syncadaptor && self.syncadaptor.customiseLoginPrompt) {
self.syncadaptor.customiseLoginPrompt(promptInfo);
}
}
});
};