From ad6d03b4eb9eecf70674475ab1e67191444ed55b Mon Sep 17 00:00:00 2001 From: Alex Gleason Date: Tue, 24 Jan 2023 12:00:34 -0600 Subject: [PATCH] Make OAuth tokens API more resilient --- app/soapbox/actions/security.ts | 2 +- .../features/auth-token-list/index.tsx | 24 ++++++++++--------- 2 files changed, 14 insertions(+), 12 deletions(-) diff --git a/app/soapbox/actions/security.ts b/app/soapbox/actions/security.ts index 48304aa23..4448104b7 100644 --- a/app/soapbox/actions/security.ts +++ b/app/soapbox/actions/security.ts @@ -50,7 +50,7 @@ const MOVE_ACCOUNT_FAIL = 'MOVE_ACCOUNT_FAIL'; const fetchOAuthTokens = () => (dispatch: AppDispatch, getState: () => RootState) => { dispatch({ type: FETCH_TOKENS_REQUEST }); - return api(getState).get('/api/oauth_tokens.json').then(({ data: tokens }) => { + return api(getState).get('/api/oauth_tokens').then(({ data: tokens }) => { dispatch({ type: FETCH_TOKENS_SUCCESS, tokens }); }).catch(() => { dispatch({ type: FETCH_TOKENS_FAIL }); diff --git a/app/soapbox/features/auth-token-list/index.tsx b/app/soapbox/features/auth-token-list/index.tsx index 360c05a47..db242ebe2 100644 --- a/app/soapbox/features/auth-token-list/index.tsx +++ b/app/soapbox/features/auth-token-list/index.tsx @@ -45,17 +45,19 @@ const AuthToken: React.FC = ({ token, isCurrent }) => { {token.app_name} - - - + {token.valid_until && ( + + + + )}