mirror of
https://github.com/gristlabs/grist-core.git
synced 2026-03-02 04:09:24 +00:00
use boot-key query parameter, tighten url match, put randomness in suggestions
This commit is contained in:
@@ -66,9 +66,9 @@ export class BaseAPI {
|
||||
// This is a fallback mechanism if auth is broken to access the
|
||||
// admin panel.
|
||||
// TODO: should this be more selective?
|
||||
if (typeof window !== 'undefined' && window.location) {
|
||||
const url = new URL(window.location.href);
|
||||
const bootKey = url.searchParams.get('boot');
|
||||
if (typeof window !== 'undefined' && window.location &&
|
||||
window.location.pathname.endsWith('/admin')) {
|
||||
const bootKey = new URLSearchParams(window.location.search).get('boot-key')
|
||||
if (bootKey) {
|
||||
this._headers['X-Boot-Key'] = bootKey;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user