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>
(cherry picked from commit 551d839f90
)
This commit is contained in:
parent
37d07f52bd
commit
e28f94bf01
1 changed files with 10 additions and 0 deletions
|
@ -1844,6 +1844,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.
|
||||
*
|
||||
|
|
Loading…
Reference in a new issue