Files
sonr/pkg/nebula/global/state/credentials.templ
T
Prad NukalaandGitHub 3790e926de feature/1109 grpc session model (#1141)
- **feat: remove Hway deployment**
- **feat: introduce session middleware for requests**
- **refactor: update path imports to use new pkg folder**
- **feat: add gRPC client for interacting with services**
- **feat: remove grpc client and use REST api**
- **refactor: move  from  to**
- **feat: add client views endpoint**
- **feat: add webauthn support**
- **closes: #1124**
- **refactor: Improve PR labeler configuration**
- **feat: add milestone discussion template**
- **feat: remove OKR tracking issue template**
- **feat: use gorilla sessions for session management**
- **refactor: move pubkey related code to**
- **<no value>**
- **refactor: remove unused identifier type**
- **feat: integrate Macaroon Keeper with Service Module**
- **refactor: rename worker routes for clarity**
2024-10-11 16:47:52 -04:00

93 lines
1.7 KiB
Templ

package state
templ NavigatorCredentialsCreate() {
<script>
function createCredential() {
navigator.credentials.create({
publicKey: {
rp: {
name: "Sonr",
},
user: {
id: new Uint8Array(0),
name: "Sonr",
displayName: "Sonr",
},
challenge: new Uint8Array(0),
pubKeyCredParams: [{
type: "public-key",
alg: -7,
}],
timeout: 60000,
excludeCredentials: [],
authenticatorSelection: {
requireResidentKey: false,
userVerification: "discouraged",
},
},
})
.then((assertion) => {
console.log("Assertion:", assertion);
})
.catch((error) => {
console.error("Error:", error);
});
}
</script>
}
templ NavigatorCredentialsGet() {
<script>
function getCredential() {
navigator.credentials.get({
publicKey: {
challenge: new Uint8Array(0),
allowCredentials: [],
timeout: 60000,
userVerification: "discouraged",
},
})
.then((assertion) => {
console.log("Assertion:", assertion);
})
.catch((error) => {
console.error("Error:", error);
});
}
</script>
}
templ NavigatorCredentialsGetAll() {
<script>
navigator.credentials.getAll({
publicKey: {
challenge: new Uint8Array(0),
allowCredentials: [],
timeout: 60000,
userVerification: "discouraged",
extensions: {
}
},
})
.then((assertion) => {
console.log("Assertion:", assertion);
})
.catch((error) => {
console.error("Error:", error);
});
</script>
}
templ NavigatorCredentialsHasPasskey() {
<script>
navigator.credentials.has()
.then((has) => {
console.log("Has Passkey:", has);
})
.catch((error) => {
console.error("Error:", error);
});
</script>
}