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

Function GetToken

controller/token.go:65–78  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

63}
64
65func GetToken(c *gin.Context) {
66 id, err := strconv.Atoi(c.Param("id"))
67 userId := c.GetInt("id")
68 if err != nil {
69 common.ApiError(c, err)
70 return
71 }
72 token, err := model.GetTokenByIds(id, userId)
73 if err != nil {
74 common.ApiError(c, err)
75 return
76 }
77 common.ApiSuccess(c, buildMaskedTokenResponse(token))
78}
79
80func GetTokenKey(c *gin.Context) {
81 id, err := strconv.Atoi(c.Param("id"))

Callers 1

Calls 4

ApiErrorFunction · 0.92
GetTokenByIdsFunction · 0.92
ApiSuccessFunction · 0.92
buildMaskedTokenResponseFunction · 0.85

Tested by 1