I am using fs in order to access images from another server, which is in the same local network (but it will soon be moved to different network so that later it will be connected via internet). The point is that to access the shared directory, I need to authenticate in the fs part. It asks for username and password when accessing manually but it does not ask anything when accessing by fs.accessSync(). It just gives me this error.
Error: UNKNOWN: unknown error, access {file path}
So, I am looking for a way to solve this problem. Be it give credentials upon accessing or any other ways. I tried giving username and password when accessing manually and it will work for a while. After some time, the error will come back again because it needs authorization once more.
UPDATE1: for more information/clarification
It is Windows authentication. It requires username and password. I access it via a local network using file sharing system.
Right now, my workaround is to provide username and password manually once and make it always remember the credentials. The fs now works as expected without providing any credentials in the fs functions.