Giter VIP home page Giter VIP logo

moneytor's People

Contributors

bsodium avatar

Watchers

 avatar  avatar

moneytor's Issues

Wakatime API access - CORS override

TL;DR

You are required to install a request interceptor browser extension such as Requestly before using this app.
Skip to the Recommended solution section for more info.

Context

At this time, Moneytor being a pretty small project, it is not a priority to have a fully fledged user system, as backend hosting services are not free. This implies that all the data displayed on the website is fetched by the client from the Wakatime API directly, and is not stored on any third party server.

However, such an architecture has some drawbacks, one of them being that Wakatime does not authorize CORS requests, and therefore blocks all requests whose origin is not registered on their side.

Existing options

I have tried solving this issue in the cleanest way possible, and believe me, the lack of effort on my side is not the issue here.

Setting up OAuth2 on a backendless architecture, as recommended by the official Wakatime documentation is both stupid and pointless, since it would require the app to store sensitive data (such as the app secret) on the client side, which poses a huge security risk. I still did try to implement such a solution, but it appears as if requesting a refresh token is not possible from a browser, so I had to give up on this idea.

Another approach would be to use the Wakatime API key, usually provided to IDE plugins such as vscode-wakatime. While this does indeed simplify the process of authenticating the user, it does not solve the CORS issue, which again cannot be solved by the client side.

Recommended solution

A reliable, though not very elegant solution is to intercept and modify all requests made by the client to the Wakatime API, and add the required headers to them. This can be achieved by using a browser extension such as Requestly. The recommended configuration is available here

It is absolutely necessary that you do enable this extension before accessing the app, as you will not be able to authenticate otherwise.

Fixes

No fixes are planned for this issue for the time being. I might reconsider this decision in the future, but for now, I am not willing to spend any money on hosting services for this project.

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.