@@ -15,8 +15,10 @@ import {
1515} from " bootstrap-vue" ;
1616import { computed , type Ref , ref } from " vue" ;
1717
18+ import { SKIP_PENDING_REQUESTS_HEADER } from " @/api/pendingRequests" ;
1819import { getOIDCIdpsWithRegistration , type OIDCConfig } from " @/components/User/ExternalIdentities/ExternalIDHelper" ;
1920import { Toast } from " @/composables/toast" ;
21+ import { discardActiveConnectionsBeforeAuthNavigation } from " @/composables/useAuthNavigation" ;
2022import localize from " @/utils/localization" ;
2123import { withPrefix } from " @/utils/redirect" ;
2224import { errorMessageAsString } from " @/utils/simple-error" ;
@@ -70,15 +72,24 @@ const registerColumnDisplay = computed(() => Boolean(props.termsUrl));
7072async function submit() {
7173 disableCreate .value = true ;
7274
75+ // Stop polling and abort in-flight axios/GalaxyApi before sending the
76+ // register POST — otherwise a late anonymous-cookie response can overwrite
77+ // the authenticated cookie we're about to receive.
78+ discardActiveConnectionsBeforeAuthNavigation ();
79+
7380 try {
74- const response = await axios .post (withPrefix (" /user/create" ), {
75- email: email .value ,
76- username: username .value ,
77- password: password .value ,
78- confirm: confirm .value ,
79- subscribe: subscribe .value ,
80- session_csrf_token: props .sessionCsrfToken ,
81- });
81+ const response = await axios .post (
82+ withPrefix (" /user/create" ),
83+ {
84+ email: email .value ,
85+ username: username .value ,
86+ password: password .value ,
87+ confirm: confirm .value ,
88+ subscribe: subscribe .value ,
89+ session_csrf_token: props .sessionCsrfToken ,
90+ },
91+ { headers: { [SKIP_PENDING_REQUESTS_HEADER ]: " 1" } },
92+ );
8293
8394 if (response .data .message && response .data .status ) {
8495 Toast .info (response .data .message );
0 commit comments