MCPcopy Create free account
hub / github.com/QuantumNous/new-api / GetPasswordEncryptionKey

Function GetPasswordEncryptionKey

controller/user.go:36–51  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

34}
35
36func 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
53func Login(c *gin.Context) {
54 if !common.PasswordLoginEnabled {

Callers

nothing calls this directly

Calls 3

ApiSuccessFunction · 0.92
ApiErrorTFunction · 0.92

Tested by

no test coverage detected