MCPcopy Create free account
hub / github.com/daodst/chat / NewSession

Method NewSession

clientapi/auth/user_interactive.go:166–175  ·  view source on GitHub ↗

NewSession returns a challenge with a new session ID and remembers the session ID

()

Source from the content-addressed store, hash-verified

164
165// NewSession returns a challenge with a new session ID and remembers the session ID
166func (u *UserInteractive) NewSession() *util.JSONResponse {
167 sessionID, err := GenerateAccessToken()
168 if err != nil {
169 logrus.WithError(err).Error("failed to generate session ID")
170 res := jsonerror.InternalServerError()
171 return &res
172 }
173 u.Sessions[sessionID] = []string{}
174 return u.Challenge(sessionID)
175}
176
177// ResponseWithChallenge mixes together a JSON body (e.g an error with errcode/message) with the
178// standard challenge response.

Callers 1

VerifyMethod · 0.95

Calls 3

ChallengeMethod · 0.95
GenerateAccessTokenFunction · 0.85
ErrorMethod · 0.45

Tested by

no test coverage detected