Skip to content

Commit b1b1ce8

Browse files
committed
CREDENTIAL: fetch via POST.
1 parent da6d473 commit b1b1ce8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

specs/credentialmanagement/index.src.html

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ <h4 id="examples-password-signin">Password-based Sign-in</h4>
263263
return;
264264
}
265265
if (credential.type == "<a const>password</a>") {
266-
fetch("https://example.com/loginEndpoint", { body: credential.<a>toFormData()</a> })
266+
fetch("https://example.com/loginEndpoint", { body: credential.<a>toFormData()</a>, method: "POST" })
267267
.then(function (response) {
268268
// Notify the user that signin succeeded! Do amazing, signed-in things!
269269
});
@@ -314,7 +314,7 @@ <h4 id="examples-federated-signin">Federated Sign-in</h4>
314314
// ...
315315
}
316316
} else {
317-
fetch("https://example.com/loginEndpoint", { body: credential.<a>toFormData()</a> })
317+
fetch("https://example.com/loginEndpoint", { body: credential.<a>toFormData()</a>, method: "POST" })
318318
.then(function (response) { ... })
319319
.catch(function (response) { ... });
320320
}
@@ -344,7 +344,7 @@ <h4 id="examples-post-signin">Post-sign-in Confirmation</h4>
344344
"<a idl for="CredentialData">id</a>": "JaneDoe98",
345345
"<a idl for="PasswordCredentialData">password</a>": "MfPeRQq5P3yVry68Q4KZMMhB"
346346
});
347-
fetch("https://example.com/sign-in/", { body: credential.<a>toFormData()</a> })
347+
fetch("https://example.com/sign-in/", { body: credential.<a>toFormData()</a>, method: "POST" })
348348
.then(function (response) {
349349
if (response.status == 200)
350350
navigator.<a attribute>credentials</a>.<a idl lt="store()">store</a>(credential);

0 commit comments

Comments
 (0)