Skip to content

Commit 378a9bf

Browse files
fix if no plugin token
1 parent bb41201 commit 378a9bf

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

dashboard-fe/pages/api/graphql.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -626,6 +626,9 @@ const checkForTokens = async (token) => {
626626
const settings = await siteSettings.find({}).toArray();
627627
const foundSettings = settings.find(({ tokens }) => {
628628
const pluginToken = tokens.find((t) => t.key === "readOnlyToken");
629+
if(!pluginToken?.value || !token) {
630+
return false
631+
}
629632
return pluginToken?.value === token;
630633
});
631634
resolve(foundSettings);

dashboard-fe/pages/api/update.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ const checkForTokens = async (token) => {
5252
const settings = await siteSettings.find({}).toArray();
5353
const foundSettings = settings.find(({ tokens }) => {
5454
const pluginToken = tokens.find((t) => t.key === "pluginToken");
55+
if(!pluginToken?.value || !token) {
56+
return false
57+
}
5558
return pluginToken?.value === token;
5659
});
5760
resolve(foundSettings);

0 commit comments

Comments
 (0)