Skip to content

Commit

Permalink
Fix example in CredentialsContainer.create() & `CredentialsContaine…
Browse files Browse the repository at this point in the history
…r.get()` (mdn#32092)
  • Loading branch information
skyclouds2001 authored Feb 16, 2024
1 parent 5022264 commit 4deba5c
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
10 changes: 6 additions & 4 deletions files/en-us/web/api/credentialscontainer/create/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -110,10 +110,12 @@ If a single credential cannot be successfully created, the Promise will resolve
```js
navigator.credentials
.create({
id: "ergnjregoith5y9865jhokmfdskl;vmfdl;kfd...",
name: "fluffybunny",
origin: "example.com",
password: "fluffyhaxx0r",
password: {
id: "ergnjregoith5y9865jhokmfdskl;vmfdl;kfd...",
name: "fluffybunny",
origin: "example.com",
password: "fluffyhaxx0r",
},
})
.then((pwdCred) => {
console.log(pwdCred.name);
Expand Down
6 changes: 4 additions & 2 deletions files/en-us/web/api/credentialscontainer/get/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -91,8 +91,10 @@ If a single credential cannot be unambiguously obtained, the Promise will resolv
```js
navigator.credentials
.get({
protocols: ["openidconnect"],
providers: ["https://www.facebook.com", "https://accounts.google.com"],
federated: {
protocols: ["openidconnect"],
providers: ["https://www.facebook.com", "https://accounts.google.com"],
},
})
.then((fedCred) => {
console.log(fedCred.provider);
Expand Down

0 comments on commit 4deba5c

Please sign in to comment.