Hi Gagan,
The issue you are encountering typically stems from how your web server or authentication middleware is handling unauthenticated requests. Can you confirm what happens if the user isn't authenticated ? Does clicking the file give a 404 error or 401 ? This is one of the secured practice to prevent URL enumeration. Your best course of action is to intercept the server response for unauthenticated requests to redirect the user to login page.