Giter Club home page Giter Club logo

Comments (4)

kaiiiz avatar kaiiiz commented on August 17, 2024

As the document mentioned, it's stored in the browser's localStorage. This is not stored in any file that can be synced across devices.

To many people are sharing their vault and their .obsidian directory 😀

Yes, this caused a serious security risk. To the best of my knowledge, storing the token in the localStorage is the best trade-off between security and convenience, unless obsidian provides a more advanced API for storing sensitive information.

from obsidian-raindrop-highlights-plugin.

dredhorse avatar dredhorse commented on August 17, 2024

uups.. now I see it, so I need to add the api token to every device.
Cumbersome but better then to store the api in a plain text file, I agree.
Didn't read through the code enough to see if there is a message poping up if the token is not there.

from obsidian-raindrop-highlights-plugin.

kaiiiz avatar kaiiiz commented on August 17, 2024

Didn't read through the code enough to see if there is a message poping up if the token is not there.

const token = this.tokenManager.get();
if (!token) {
throw new Error("Invalid token");
}

Token checking logic is at the beginning of the API request, and the error will be resolved in the syncCollection function.

async syncCollection(collection: SyncCollection) {
new Notice(`Sync Raindrop collection: ${collection.title}`);
const highlightsFolder = this.plugin.settings.highlightsFolder;
const collectionFolder = `${highlightsFolder}/${collection["title"]}`;
const lastSyncDate = this.plugin.settings.syncCollections[collection.id].lastSyncDate;
let articles: RaindropArticle[] = [];
try {
console.debug('start sync collection:', collection.title, "last sync at:", lastSyncDate);
articles = await this.api.getRaindropsAfter(collection.id, lastSyncDate);
await this.syncArticles(articles, collectionFolder);
await this.syncCollectionComplete(collection);
} catch (e) {
console.error(e);
new Notice(`Sync Raindrop collection ${collection.title} failed: ${e.message}`);
}
}

I'm considering moving the checking logic inside the get function of tokenManager.

from obsidian-raindrop-highlights-plugin.

dredhorse avatar dredhorse commented on August 17, 2024

ah, thanks for this information

from obsidian-raindrop-highlights-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.