feat: add User-Agent and Platform to session

This commit is contained in:
Prad Nukala
2024-10-12 12:52:20 -04:00
parent 58aa71997d
commit 104df074e9
6 changed files with 80 additions and 137 deletions
+3 -7
View File
@@ -5,13 +5,9 @@ import (
"github.com/go-webauthn/webauthn/protocol/webauthncose"
)
func NewCredentialCreationOptions(subject, address string) (*protocol.PublicKeyCredentialCreationOptions, error) {
chl, err := protocol.CreateChallenge()
if err != nil {
return nil, err
}
func NewCredentialCreationOptions(subject, address string, challenge protocol.URLEncodedBase64) *protocol.PublicKeyCredentialCreationOptions {
return &protocol.PublicKeyCredentialCreationOptions{
Challenge: chl,
Challenge: challenge,
User: protocol.UserEntity{
DisplayName: subject,
ID: address,
@@ -19,7 +15,7 @@ func NewCredentialCreationOptions(subject, address string) (*protocol.PublicKeyC
Attestation: defaultAttestation(),
AuthenticatorSelection: defaultAuthenticatorSelection(),
Parameters: defaultCredentialParameters(),
}, nil
}
}
func buildUserEntity(userID string) protocol.UserEntity {