MCPcopy Index your code
hub / github.com/aiprodcoder/MIXAPI / GenerateOAuthCode

Function GenerateOAuthCode

controller/github.go:221–239  ·  view source on GitHub ↗
(c *gin.Context)

Source from the content-addressed store, hash-verified

219}
220
221func GenerateOAuthCode(c *gin.Context) {
222 session := sessions.Default(c)
223 state := common.GetRandomString(12)
224 affCode := c.Query("aff")
225 if affCode != "" {
226 session.Set("aff", affCode)
227 }
228 session.Set("oauth_state", state)
229 err := session.Save()
230 if err != nil {
231 common.ApiError(c, err)
232 return
233 }
234 c.JSON(http.StatusOK, gin.H{
235 "success": true,
236 "message": "",
237 "data": state,
238 })
239}

Callers

nothing calls this directly

Calls 3

GetRandomStringFunction · 0.92
ApiErrorFunction · 0.92
SaveMethod · 0.80

Tested by

no test coverage detected