mirror of
https://github.com/infiniflow/ragflow.git
synced 2026-07-16 20:57:21 +08:00
Go: default public key (#16265)
### What problem does this PR solve? Provider default public key for CLI ### Type of change - [x] Refactoring Signed-off-by: Jin Hai <haijin.chn@gmail.com>
This commit is contained in:
@@ -283,8 +283,13 @@ func (c *CLI) RegisterUser(cmd *Command) (ResponseIf, error) {
|
||||
return nil, fmt.Errorf("no password")
|
||||
}
|
||||
|
||||
publicKey, err := c.GetPublicKeyPEM()
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to get public key: %w", err)
|
||||
}
|
||||
|
||||
// Encrypt password using RSA
|
||||
encryptedPassword, err := EncryptPassword(password)
|
||||
encryptedPassword, err := EncryptPassword(password, publicKey)
|
||||
if err != nil {
|
||||
return nil, fmt.Errorf("failed to encrypt password: %w", err)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user