v0.2.92
This commit is contained in:
1 parent
5cb6960b04
commit
0d7ffea17a
13 files changed
+17
-135
No files matched your search
@@ -35,7 +35,7 @@ export function clearResourceAccessState() {
|
||||
if (key?.startsWith("rustpad:access:")) localStorage.removeItem(key);
|
||||
}
|
||||
}
|
||||
// Remove plaintext passwords saved by the previous frontend version.
|
||||
|
||||
for (let i = localStorage.length - 1; i >= 0; i--) {
|
||||
const key = localStorage.key(i);
|
||||
if (key?.startsWith("rustpad:workspace:") && key.endsWith(":password")) localStorage.removeItem(key);
|
||||
@@ -43,8 +43,7 @@ for (let i = localStorage.length - 1; i >= 0; i--) {
|
||||
|
||||
const NICKNAME_KEY = "rustpad:nickname";
|
||||
const NICKNAME_COOKIE = "rustpad_nickname";
|
||||
// A session cookie is shared by tabs, but disappears when the browser session
|
||||
// ends. The nickname is not an authentication secret.
|
||||
|
||||
function getCookie(name) {
|
||||
const prefix = `${name}=`;
|
||||
const item = document.cookie.split("; ").find(value => value.startsWith(prefix));
|
||||
@@ -79,7 +78,6 @@ export function getGuestId() {
|
||||
}
|
||||
|
||||
const AUTH_STATE_KEY = "rustpad:auth-state";
|
||||
// Remove browser-readable account tokens created by older frontend versions.
|
||||
localStorage.removeItem("rustpad:auth-token");
|
||||
sessionStorage.removeItem("rustpad:auth-token");
|
||||
export function getAuthToken() { return localStorage.getItem(AUTH_STATE_KEY) ? "cookie" : ""; }
|
||||
|
||||
Reference in new issue
Block a user