Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
poopoothegorilla committed Jan 23, 2024
1 parent abeb6b0 commit cc7212b
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions core/sessions/webauthn.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,10 +7,10 @@ import (
"strings"
"sync"

"cosmossdk.io/errors"
"github.com/go-webauthn/webauthn/protocol"
"github.com/go-webauthn/webauthn/webauthn"
sqlxTypes "github.com/jmoiron/sqlx/types"
pkgerrors "github.com/pkg/errors"
)

// WebAuthn holds the credentials for API user.
Expand Down Expand Up @@ -93,7 +93,7 @@ func (store *WebAuthnSessionStore) FinishWebAuthnRegistration(user User, uwas []

credential, err := webAuthn.FinishRegistration(waUser, sessionData, response)
if err != nil {
return nil, errors.Wrap(err, "failed to FinishRegistration")
return nil, pkgerrors.Wrap(err, "failed to FinishRegistration")
}

return credential, nil
Expand Down Expand Up @@ -137,7 +137,7 @@ func FinishWebAuthnLogin(user User, uwas []WebAuthn, sr SessionRequest) error {
})

if err != nil {
return errors.Wrapf(err, "failed to create webAuthn structure with RPID: %s and RPOrigin: %s", sr.WebAuthnConfig.RPID, sr.WebAuthnConfig.RPOrigin)
return pkgerrors.Wrapf(err, "failed to create webAuthn structure with RPID: %s and RPOrigin: %s", sr.WebAuthnConfig.RPID, sr.WebAuthnConfig.RPOrigin)
}

credential, err := protocol.ParseCredentialRequestResponseBody(strings.NewReader(sr.WebAuthnData))
Expand Down Expand Up @@ -272,7 +272,7 @@ func (store *WebAuthnSessionStore) take(key string) (val string, ok bool) {
func (store *WebAuthnSessionStore) GetWebauthnSession(key string) (data webauthn.SessionData, err error) {
assertion, ok := store.take(key)
if !ok {
err = errors.New("assertion not in challenge store")
err = pkgerrors.New("assertion not in challenge store")
return
}
err = json.Unmarshal([]byte(assertion), &data)
Expand Down

0 comments on commit cc7212b

Please sign in to comment.