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:
parent
49c6a810e9
commit
551d839f90
1 changed files with 10 additions and 0 deletions
|
@ -1846,6 +1846,16 @@
|
||||||
return env.sessionid || '00000000000000000000000000000000';
|
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.
|
* Retrieve data from the local session storage.
|
||||||
*
|
*
|
||||||
|
|
Loading…
Reference in a new issue