RepositoryRegistration RepoReg = new RepositoryRegistration(LFRepoServer, LFRepoName); Session Sess = new Session(); if (LFRepoUsername != "" | LFRepoUsername != null) { Sess.LogIn(LFRepoUsername, LFRepoPassword, RepoReg); } else { Sess.LogIn(RepoReg); }
I have above code for a custom app where if user enter a username and password, then I use those values to create my session but if users doesn't enter any username and password and select a checkbox 'Windows Authentication', I use the Sess.Login(RepoReg) in else block.
This code works fine for the if block but doesn't work for the else block and throws username and password can't be blank error.
I believe this approach works fine if we try to login to LF using LFSO83.lib functions but if I try RepositoryAccess, this doesn't run.
What am I missing?