mirror of
https://github.com/d0zingcat/obsidian-send-to-ghost.git
synced 2026-05-13 23:16:49 +00:00
Check that Ghost API key is in a valid format
This commit is contained in:
@@ -24,6 +24,7 @@ export const publishPost = async (
|
||||
) => {
|
||||
// Ghost Url and Admin API key
|
||||
const key = settings.adminToken;
|
||||
if (key.includes(":")) {
|
||||
const [id, secret] = key.split(":");
|
||||
|
||||
// Create the token (including decoding secret)
|
||||
@@ -78,4 +79,7 @@ export const publishPost = async (
|
||||
new Notice(`Couldn't connect to the Ghost API. Is the API URL and Admin API Key correct?
|
||||
|
||||
${error.name}: ${error.message}`)
|
||||
}}
|
||||
else {
|
||||
new Notice("Error: Ghost API Key is invalid.")
|
||||
}};
|
||||
|
||||
Reference in New Issue
Block a user