Refreshable connections, refactoring, access-token endpoint

- Aded /users/@me/connections/:connection_name/:connection_id/access-token
- Replaced `access_token` property on ConnectedAccount with `token_data` object for refreshing tokens
- Made a common interface for connection things like ComonOAuthTokenResponse
- Added `RefreshableConnection` class
- Added token refresh to Spotify connection (disabled)
This commit is contained in:
Puyodead1
2023-03-18 19:27:39 -04:00
parent 50f068400d
commit 0db1fa5f0b
18 changed files with 292 additions and 111 deletions
+2 -2
View File
@@ -23,8 +23,8 @@ export class ConnectedAccountDTO {
this.id = connectedAccount.external_id;
this.user_id = connectedAccount.user_id;
this.access_token =
connectedAccount.access_token && with_token
? connectedAccount.access_token
connectedAccount.token_data && with_token
? connectedAccount.token_data.access_token
: undefined;
this.friend_sync = connectedAccount.friend_sync;
this.name = connectedAccount.name;