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
551d839f90853b58f81d124c77442009d4df0cb4)
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.
*