Hello again,
First of all, sorry in advance for my multiple posts with beginner questions, still trying to get the hang of the feature-filled API of Servoy.
I first created an unsecure login form that just checked the Username and Password in the DB, and then proceeded.
After looking around though, it seems I should be using the security functions that come with Servoy.
I have written some code to try and perform this task:
function loginToForm(event){
var userUID = security.getUserUID(userNameField);
var userGroups = security.getUserGroups(userUID);
var checkPW = security.checkPassword(userUID,passWordField);
if(checkPW){
security.login(userNameField,userUID,userGroups);
application.output(‘logged in’);
}
else {
application.output(‘failed login’);
}
}
userNameField and passWordField are tied to text areas on the form where the user inputs their information.
I am getting an error on the security.login line, saying I cannot provide String,String,JSDataSet, and instead to provide String,Object,Array.
As you can tell I am using the supported methods that come with the Security property. Why won’t the provided methods fit together? Shouldn’t security.getUserUID return the UID in a manner that would fit the security.login method?
Thanks in advance for any assistance!
Chris