mirror of
https://github.com/sonr-io/sonr.git
synced 2026-08-02 17:31:39 +00:00
- **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**
93 lines
1.7 KiB
Templ
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>
|
|
}
|