mirror of
https://github.com/openwrt/luci.git
synced 2025-12-26 13:26:20 +04:00
luci-base: luci.js: add LuCI.session.getToken()
Since we're already have LuCI.session.getID() we should mirror the same interface for retrieving the session token. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
This commit is contained in:
@@ -1846,6 +1846,16 @@
|
||||
return env.sessionid || '00000000000000000000000000000000';
|
||||
},
|
||||
|
||||
/**
|
||||
* 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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user