feat(firefly-iii): add firefly iii integration

This commit is contained in:
Rıdvan Akca
2024-05-20 16:49:08 +02:00
parent 5b7b8c934f
commit bc67e9c4c4
13 changed files with 252 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
import { URLSearchParams } from 'node:url';
const refreshToken = async ($) => {
const params = new URLSearchParams({
client_id: $.auth.data.clientId,
client_secret: $.auth.data.clientSecret,
grant_type: 'refresh_token',
refresh_token: $.auth.data.refreshToken,
});
const { data } = await $.http.post(`/oauth/token`, params.toString());
await $.auth.set({
accessToken: data.access_token,
expiresIn: data.expires_in,
tokenType: data.token_type,
});
};
export default refreshToken;