Skip to content
Snippets Groups Projects
Commit 6909d025 authored by vkovtun's avatar vkovtun
Browse files

BIS-774: Rewriting callbacks to promises. Fixed the issue with not working login page.

parent 8cbb1f48
No related branches found
No related tags found
1 merge request!40SSDM-13578 : 2PT : Database and V3 Implementation - include the new AFS "free"...
...@@ -309,8 +309,11 @@ DataStoreServer.prototype.login = function(userId, userPassword) { ...@@ -309,8 +309,11 @@ DataStoreServer.prototype.login = function(userId, userPassword) {
this._internal.datastoreUrl, this._internal.datastoreUrl,
encodeParams(data) encodeParams(data)
).then((loginResponse) => { ).then((loginResponse) => {
datastoreObj._internal.sessionToken = loginResponse; return new Promise((resolve, reject) => {
datastoreObj.rememberSession(); datastoreObj._internal.sessionToken = loginResponse;
datastoreObj.rememberSession();
resolve(loginResponse);
})
}); });
} }
......
...@@ -62,11 +62,12 @@ dssClientLoginPage.prototype.configure = function(){ ...@@ -62,11 +62,12 @@ dssClientLoginPage.prototype.configure = function(){
document.getElementById("login-form").onsubmit = function() { document.getElementById("login-form").onsubmit = function() {
loginPage.datastore.login(document.getElementById("username").value.trim(), loginPage.datastore.login(document.getElementById("username").value.trim(),
document.getElementById("password").value.trim()).then((data) => { document.getElementById("password").value.trim())
document.getElementById("username").value = ''; .then((data) => {
document.getElementById("password").value = ''; document.getElementById("username").value = '';
loginPage.onLogin(data); document.getElementById("password").value = '';
}) loginPage.onLogin(data);
})
}; };
loginPage.datastore.ifRestoredSessionActive().then((data) => loginPage.onLogin(data)); loginPage.datastore.ifRestoredSessionActive().then((data) => loginPage.onLogin(data));
......
...@@ -8,11 +8,11 @@ writeAheadLogRoot=./target/tests/transactions ...@@ -8,11 +8,11 @@ writeAheadLogRoot=./target/tests/transactions
storageRoot=./target/tests/storage storageRoot=./target/tests/storage
httpServerClass=ch.ethz.sis.afsserver.http.impl.NettyHttpServer httpServerClass=ch.ethz.sis.afsserver.http.impl.NettyHttpServer
httpServerUri=/fileserver httpServerUri=/data-store-server
httpServerPort=8085 httpServerPort=8085
httpMaxContentLength=1024 httpMaxContentLength=1024
maxReadSizeInBytes=1024 maxReadSizeInBytes=1048576
authenticationInfoProviderClass=ch.ethz.sis.afsserver.worker.providers.impl.DummyAuthenticationInfoProvider authenticationInfoProviderClass=ch.ethz.sis.afsserver.worker.providers.impl.DummyAuthenticationInfoProvider
authorizationInfoProviderClass=ch.ethz.sis.afsserver.worker.providers.impl.DummyAuthorizationInfoProvider authorizationInfoProviderClass=ch.ethz.sis.afsserver.worker.providers.impl.DummyAuthorizationInfoProvider
poolSize=50 poolSize=50
......
...@@ -29,7 +29,7 @@ httpServerPort=8085 ...@@ -29,7 +29,7 @@ httpServerPort=8085
httpServerUri=/fileserver httpServerUri=/fileserver
httpMaxContentLength=1024 httpMaxContentLength=1024
maxReadSizeInBytes=1024 maxReadSizeInBytes=1048576
authenticationInfoProviderClass=ch.ethz.sis.afsserver.worker.providers.impl.DummyAuthenticationInfoProvider authenticationInfoProviderClass=ch.ethz.sis.afsserver.worker.providers.impl.DummyAuthenticationInfoProvider
authorizationInfoProviderClass=ch.ethz.sis.afsserver.worker.providers.impl.DummyAuthorizationInfoProvider authorizationInfoProviderClass=ch.ethz.sis.afsserver.worker.providers.impl.DummyAuthorizationInfoProvider
poolSize=50 poolSize=50
......
...@@ -29,7 +29,7 @@ httpServerPort=8085 ...@@ -29,7 +29,7 @@ httpServerPort=8085
httpServerUri=/fileserver httpServerUri=/fileserver
httpMaxContentLength=1024 httpMaxContentLength=1024
maxReadSizeInBytes=1024 maxReadSizeInBytes=1048576
authenticationInfoProviderClass=ch.ethz.sis.afsserver.worker.providers.impl.OpenBISAuthenticationInfoProvider authenticationInfoProviderClass=ch.ethz.sis.afsserver.worker.providers.impl.OpenBISAuthenticationInfoProvider
authorizationInfoProviderClass=ch.ethz.sis.afsserver.worker.providers.impl.OpenBISAuthorizationInfoProvider authorizationInfoProviderClass=ch.ethz.sis.afsserver.worker.providers.impl.OpenBISAuthorizationInfoProvider
poolSize=50 poolSize=50
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment