[ARVADOS-WORKBENCH2] updated: 2.1.0-230-geb633efd

Git user git at public.arvados.org
Mon Mar 8 17:05:58 UTC 2021


Summary of changes:
 src/store/auth/auth-action.ts  | 5 ++++-
 src/store/auth/auth-reducer.ts | 2 ++
 2 files changed, 6 insertions(+), 1 deletion(-)

       via  eb633efdb3fa8ecb0c2c6a5e35916585282436ea (commit)
      from  ab1faae94143599e5537b40211d6b4370e0ecef6 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.


commit eb633efdb3fa8ecb0c2c6a5e35916585282436ea
Author: Lucas Di Pentima <lucas at di-pentima.com.ar>
Date:   Mon Mar 8 14:04:45 2021 -0300

    16848: Resets extra cached token from the store when not valid anymore.
    
    This is to make the "Get API token" dialog default to the wb2's session token.
    
    Arvados-DCO-1.1-Signed-off-by: Lucas Di Pentima <lucas at di-pentima.com.ar>

diff --git a/src/store/auth/auth-action.ts b/src/store/auth/auth-action.ts
index 27558618..4f576fe4 100644
--- a/src/store/auth/auth-action.ts
+++ b/src/store/auth/auth-action.ts
@@ -23,6 +23,7 @@ export const authActions = unionize({
     LOGOUT: ofType<{ deleteLinkData: boolean }>(),
     SET_CONFIG: ofType<{ config: Config }>(),
     SET_EXTRA_TOKEN: ofType<{ extraApiToken: string, extraApiTokenExpiration?: Date }>(),
+    RESET_EXTRA_TOKEN: {},
     INIT_USER: ofType<{ user: User, token: string, tokenExpiration?: Date }>(),
     USER_DETAILS_REQUEST: {},
     USER_DETAILS_SUCCESS: ofType<User>(),
@@ -112,7 +113,9 @@ export const getNewExtraToken = (reuseStored: boolean = false) =>
                     extraApiTokenExpiration: client.expiresAt ? new Date(client.expiresAt): undefined,
                 }));
                 return extraToken;
-            } catch (e) { }
+            } catch (e) {
+                dispatch(authActions.RESET_EXTRA_TOKEN());
+            }
         }
         const user = getState().auth.user;
         const loginCluster = getState().auth.config.clusterConfig.Login.LoginCluster;
diff --git a/src/store/auth/auth-reducer.ts b/src/store/auth/auth-reducer.ts
index 7459b7ac..b29cf341 100644
--- a/src/store/auth/auth-reducer.ts
+++ b/src/store/auth/auth-reducer.ts
@@ -69,6 +69,8 @@ export const authReducer = (services: ServiceRepository) => (state = initialStat
             }),
         SET_EXTRA_TOKEN: ({ extraApiToken, extraApiTokenExpiration }) =>
             ({ ...state, extraApiToken, extraApiTokenExpiration }),
+        RESET_EXTRA_TOKEN: () =>
+            ({ ...state, extraApiToken: undefined, extraApiTokenExpiration: undefined }),
         INIT_USER: ({ user, token, tokenExpiration }) =>
             ({ ...state,
                 user,

-----------------------------------------------------------------------


hooks/post-receive
-- 




More information about the arvados-commits mailing list