(ctx context.Context, uid int, name string, credential *webauthn.Credential)
| 180 | } |
| 181 | |
| 182 | func (c *userClient) AddPasskey(ctx context.Context, uid int, name string, credential *webauthn.Credential) (*ent.Passkey, error) { |
| 183 | return c.client.Passkey.Create(). |
| 184 | SetName(name). |
| 185 | SetCredentialID(base64.StdEncoding.EncodeToString(credential.ID)). |
| 186 | SetUserID(uid). |
| 187 | SetCredential(credential). |
| 188 | Save(ctx) |
| 189 | } |
| 190 | |
| 191 | func (c *userClient) RemovePasskey(ctx context.Context, uid int, keyId string) error { |
| 192 | ctx = schema.SkipSoftDelete(ctx) |
nothing calls this directly
no test coverage detected