markusahlstrand / cloudworker-proxy

An api gateway for cloudflare workers
MIT License
194 stars 22 forks source link

Encrypt the oauth tokens rather than doing splitting #41

Closed markusahlstrand closed 4 years ago

markusahlstrand commented 4 years ago

The current solution for storing tokens in cookies is a bit wonky.

Think it would be better to create two shortIds that are concatenated in the cookie when a user signs in. One key is used as a key for kv-storage and the second to AES encrypt the json. This way there's no way to get access to any tokens just by having access to the KV-Storage.