Skip to content

Commit 6874ae1

Browse files
committed
https://github.com/haxtheweb/issues/issues/2370
1 parent a827460 commit 6874ae1

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/cli.js

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,11 +84,20 @@ class Res {
8484

8585
// method to bridge api calls in similar manner given a site already loaded into scope
8686
export async function cliBridge(op, body = {}) {
87+
// when CLI is detected, we assume the user is authenticated
88+
// this is just to ensure that backend calls looking for tokens to exist
89+
// get the data they are expecting
90+
// this does not get validated bc of being a CLI
91+
const fakeToken = HAXCMS.getRequestToken(HAXCMS.getActiveUserName());
8792
let req = {
8893
route: {
8994
path: `${HAXCMS.basePath}${HAXCMS.systemRequestBase}${route}`
9095
},
9196
body: body,
97+
query: {
98+
user_token: fakeToken,
99+
site_token: fakeToken,
100+
},
92101
method: "post"
93102
};
94103

0 commit comments

Comments
 (0)