MCPcopy Create free account
hub / github.com/OpenListTeam/OpenList / ResetToken

Function ResetToken

server/handles/setting.go:19–28  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

17)
18
19func ResetToken(c *gin.Context) {
20 token := random.Token()
21 item := model.SettingItem{Key: "token", Value: token, Type: conf.TypeString, Group: model.SINGLE, Flag: model.PRIVATE}
22 if err := op.SaveSettingItem(&item); err != nil {
23 common.ErrorResp(c, err, 500)
24 return
25 }
26 sign.Instance()
27 common.SuccessResp(c, token)
28}
29
30func GetSetting(c *gin.Context) {
31 key := c.Query("key")

Callers

nothing calls this directly

Calls 5

TokenFunction · 0.92
SaveSettingItemFunction · 0.92
ErrorRespFunction · 0.92
InstanceFunction · 0.92
SuccessRespFunction · 0.92

Tested by

no test coverage detected