mirror of
https://github.com/onsonr/hway.git
synced 2025-03-10 21:09:11 +00:00
20 lines
445 B
Go
20 lines
445 B
Go
|
package context
|
||
|
|
||
|
import (
|
||
|
"github.com/go-webauthn/webauthn/protocol"
|
||
|
)
|
||
|
|
||
|
func (c *GatewayContext) NewChallenge() string {
|
||
|
chal, _ := protocol.CreateChallenge()
|
||
|
chalStr := chal.String()
|
||
|
return chalStr
|
||
|
}
|
||
|
|
||
|
func (cc *GatewayContext) ListCredentials(handle string) ([]*CredentialDescriptor, error) {
|
||
|
creds, err := cc.GetCredentialsByHandle(bgCtx(), handle)
|
||
|
if err != nil {
|
||
|
return nil, err
|
||
|
}
|
||
|
return CredentialArrayToDescriptors(creds), nil
|
||
|
}
|