[server] Change param type from uuid to string

This commit is contained in:
Neeraj Gupta 2024-03-11 22:40:30 +05:30 committed by Neeraj Gupta
parent 00f45ef39d
commit e843ea6669
2 changed files with 2 additions and 2 deletions

View file

@ -14,7 +14,7 @@ type Passkey struct {
var MaxPasskeys = 10
type SetPasskeyRecoveryRequest struct {
Secret uuid.UUID `json:"secret" binding:"required"`
Secret string `json:"secret" binding:"required"`
// The UserSecretCipher has SkipSecret encrypted with the user's recoveryKey
// If the user sends the correct UserSecretCipher, we can be sure that the user has the recoveryKey,
// and we can allow the user to recover their MFA.

View file

@ -35,7 +35,7 @@ func (r *Repository) GetStatus(userID int64) (*ente.TwoFactorRecoveryStatus, err
}
func (r *Repository) SetPasskeyRecovery(ctx context.Context, userID int64, req *ente.SetPasskeyRecoveryRequest) error {
serveEncPasskey, encErr := crypto.Encrypt(req.Secret.String(), r.SecretEncryptionKey)
serveEncPasskey, encErr := crypto.Encrypt(req.Secret, r.SecretEncryptionKey)
if encErr != nil {
return stacktrace.Propagate(encErr, "failed to encrypt passkey secret")
}