We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent a827460 commit 6874ae1Copy full SHA for 6874ae1
src/cli.js
@@ -84,11 +84,20 @@ class Res {
84
85
// method to bridge api calls in similar manner given a site already loaded into scope
86
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());
92
let req = {
93
route: {
94
path: `${HAXCMS.basePath}${HAXCMS.systemRequestBase}${route}`
95
},
96
body: body,
97
+ query: {
98
+ user_token: fakeToken,
99
+ site_token: fakeToken,
100
+ },
101
method: "post"
102
};
103
0 commit comments