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