(c *gin.Context)
| 34 | } |
| 35 | |
| 36 | func GetPasswordEncryptionKey(c *gin.Context) { |
| 37 | if !common.PasswordLoginEncryptionEnabled { |
| 38 | common.ApiSuccess(c, gin.H{"enabled": false}) |
| 39 | return |
| 40 | } |
| 41 | keyID, publicKey := common.PasswordEncryptionPublicKey() |
| 42 | if keyID == "" || publicKey == "" { |
| 43 | common.ApiErrorT(c, "Database error, please contact the administrator") |
| 44 | return |
| 45 | } |
| 46 | common.ApiSuccess(c, gin.H{ |
| 47 | "enabled": true, |
| 48 | "kid": keyID, |
| 49 | "public_key": publicKey, |
| 50 | }) |
| 51 | } |
| 52 | |
| 53 | func Login(c *gin.Context) { |
| 54 | if !common.PasswordLoginEnabled { |
nothing calls this directly
no test coverage detected