summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
-rw-r--r--modules/luci-base/htdocs/luci-static/resources/luci.js10
1 files changed, 10 insertions, 0 deletions
diff --git a/modules/luci-base/htdocs/luci-static/resources/luci.js b/modules/luci-base/htdocs/luci-static/resources/luci.js
index c4f998a406..4b6894c080 100644
--- a/modules/luci-base/htdocs/luci-static/resources/luci.js
+++ b/modules/luci-base/htdocs/luci-static/resources/luci.js
@@ -1847,6 +1847,16 @@
},
/**
+ * Retrieve the current session token.
+ *
+ * @returns {string|null}
+ * Returns the current session token or `null` if not logged in.
+ */
+ getToken: function() {
+ return env.token || null;
+ },
+
+ /**
* Retrieve data from the local session storage.
*
* @param {string} [key]