MCPcopy Create free account
hub / github.com/error311/FileRise / maybeRestoreAuthFileLinkReturnUrl

Function maybeRestoreAuthFileLinkReturnUrl

public/js/main.js:174–188  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

172}
173
174function maybeRestoreAuthFileLinkReturnUrl() {
175 const target = consumeAuthFileLinkReturnUrl();
176 if (!target) return false;
177 try {
178 const targetUrl = new URL(target, window.location.href);
179 const token = String(targetUrl.searchParams.get(AUTH_FILE_LINK_PARAM) || '').trim();
180 if (!token) return false;
181 const currentSafe = sanitizeRedirect(getCurrentRelativeUrl(), { fallback: '' }) || '';
182 if (target === currentSafe) return false;
183 window.location.replace(target);
184 return true;
185 } catch (e) {
186 return false;
187 }
188}
189
190function clearAuthFileLinkFromUrl() {
191 try {

Callers 1

main.jsFile · 0.85

Calls 4

getCurrentRelativeUrlFunction · 0.85
sanitizeRedirectFunction · 0.70
getMethod · 0.45

Tested by

no test coverage detected