V2 API with Tokens!
Hiya! So I noticed BlueBubbles doesn't use tokens and has the interesting design choice of using url params instead of headers so I created a version 2 of the API with user created tokens! This is very much a proof of concept, it has not been thoroughly tested, it was hacked together in 4 hours. This is the first time I've written in Typescript so lemme know if something's wrong!
Changes:
- Token panel in settings
- V2 API requiring a
Tokenheader with the value of[token name] [token password] - Two new API routes
token/registerPOST{"name": "token name", "password": "token password"}token/deletePOST{"name": "token name"}
Added route: token/refresh POST {"name": "token name", "password": "token password", expireAt: 0}
Where expireAt is how much longer to add to the expiration in Unix time:)
Sorry I havent looked into this yet. I'm waiting for the right time to properly implement it