How to read the /etc/password_key.txt file content(using file path and not browse option) in javascript

when i login luci page, i want to read the system file path content(like, /etc/password_key) via javascript (./usr/lib/lua/luci/view/themes/argon/sysauth.
htm)..

java script , html and lua code parts are exists in this ,htm file..
whenever login with credentials, need to read the key file content via js code ..Please share your info ..

  1. Also can we possible to read login password value via lua <%...%> code in this same file(sysauth.htm) after click login button? if yes please share it

From wiki git/browsing there seems to be 2 options.

  1. Use luci API - https://github.com/openwrt/luci?tab=readme-ov-file
    http://openwrt.github.io/luci/api/index.html

  2. Add ubus call via rpcd with some bash script https://openwrt.org/docs/techref/rpcd

Both propably end the same way.

After that use fronend API to get return of the content. https://openwrt.github.io/luci/jsapi/LuCI.rpc.html

You propably have to be logged in.