[arvados-workbench2] updated: 2.4.0-149-gbbc64c16

git repository hosting git at public.arvados.org
Wed Jul 20 15:29:51 UTC 2022


Summary of changes:
 src/views-components/login-form/login-form.tsx | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

       via  bbc64c1641d37f8e793a901b93be439e7a8f229e (commit)
      from  620d5745b5fb97e08945c15048ad5439e5bbe80c (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 bbc64c1641d37f8e793a901b93be439e7a8f229e
Author: Stephen Smith <stephen at curii.com>
Date:   Wed Jul 20 11:29:18 2022 -0400

    18965: Redirect to current url after login when doing password login
    
    Arvados-DCO-1.1-Signed-off-by: Stephen Smith <stephen at curii.com>

diff --git a/src/views-components/login-form/login-form.tsx b/src/views-components/login-form/login-form.tsx
index aac13642..3aa9e3f2 100644
--- a/src/views-components/login-form/login-form.tsx
+++ b/src/views-components/login-form/login-form.tsx
@@ -12,6 +12,7 @@ import { AxiosPromise } from 'axios';
 import { DispatchProp } from 'react-redux';
 import { saveApiToken } from 'store/auth/auth-action';
 import { navigateToRootProject } from 'store/navigation/navigation-action';
+import { replace } from 'react-router-redux';
 
 type CssRules = 'root' | 'loginBtn' | 'card' | 'wrapper' | 'progress';
 
@@ -87,8 +88,11 @@ export const LoginForm = withStyles(styles)(
                 setSubmitting(false);
                 if (response.data.uuid && response.data.api_token) {
                     const apiToken = `v2/${response.data.uuid}/${response.data.api_token}`;
+                    const rd = new URL(window.location.href);
+                    const rdUrl = rd.pathname + rd.search;
                     dispatch<any>(saveApiToken(apiToken)).finally(
-                        () => dispatch(navigateToRootProject));
+                        () => rdUrl === '/' ? dispatch(navigateToRootProject) : dispatch(replace(rdUrl))
+                    );
                 } else {
                     setError(true);
                     setHelperText(response.data.message || 'Please try again');

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


hooks/post-receive
-- 




More information about the arvados-commits mailing list