mirror of
https://github.com/element-hq/element-web
synced 2024-11-28 04:21:57 +03:00
Log when sessions are saved/restored/not found
This commit is contained in:
parent
9525808cd0
commit
ef9b4ab1e6
1 changed files with 5 additions and 0 deletions
|
@ -67,8 +67,12 @@ if (localStorage) {
|
|||
var user_id = localStorage.getItem("mx_user_id");
|
||||
var guestAccess = new GuestAccess(localStorage);
|
||||
if (access_token && user_id && hs_url) {
|
||||
console.log("Restoring session for %s", user_id);
|
||||
createClient(hs_url, is_url, user_id, access_token, guestAccess);
|
||||
}
|
||||
else {
|
||||
console.log("Session not found.");
|
||||
}
|
||||
}
|
||||
|
||||
class MatrixClient {
|
||||
|
@ -130,6 +134,7 @@ class MatrixClient {
|
|||
localStorage.setItem("mx_is_url", is_url);
|
||||
localStorage.setItem("mx_user_id", user_id);
|
||||
localStorage.setItem("mx_access_token", access_token);
|
||||
console.log("Session persisted for %s", user_id);
|
||||
} catch (e) {
|
||||
console.warn("Error using local storage: can't persist session!");
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue