File tree Expand file tree Collapse file tree 1 file changed +4
-3
lines changed
bootstrap_modal_forms/static/js Expand file tree Collapse file tree 1 file changed +4
-3
lines changed Original file line number Diff line number Diff line change @@ -21,7 +21,7 @@ const modalFormCallback = function (settings) {
2121 } )
2222 }
2323
24- fetch ( settings . formURL ) . then ( res => {
24+ fetch ( settings . formURL , { credentials : settings . credentials } ) . then ( res => {
2525 // Get content from target URL
2626 return res . text ( ) ;
2727 } ) . then ( data => {
@@ -131,6 +131,7 @@ const submitForm = function (settings) {
131131 fetch ( form . action , {
132132 method : form . method ,
133133 body : formData ,
134+ credentials : settings . credentials ,
134135 } ) . then ( res => {
135136 return res . text ( ) ;
136137 } ) . then ( data => {
@@ -145,7 +146,7 @@ const submitForm = function (settings) {
145146
146147 if ( asyncSettings . dataUrl ) {
147148 // Update page without refresh
148- fetch ( asyncSettings . dataUrl ) . then ( res => res . json ( ) ) . then ( data => {
149+ fetch ( asyncSettings . dataUrl , { credentials : settings . credentials } ) . then ( res => res . json ( ) ) . then ( data => {
149150 // Update page
150151 let dataElement = document . querySelector ( asyncSettings . dataElementId ) ;
151152 if ( dataElement ) {
@@ -161,7 +162,7 @@ const submitForm = function (settings) {
161162 bootstrap . Modal . getInstance ( modal ) . hide ( ) ;
162163 } else {
163164 // Reload form
164- fetch ( settings . formURL ) . then ( res => {
165+ fetch ( settings . formURL , { credentials : settings . credentials } ) . then ( res => {
165166 return res . text ( ) ;
166167 } ) . then ( data => {
167168 let content = modal . querySelector ( settings . modalContent ) ;
You can’t perform that action at this time.
0 commit comments