NewSession returns a challenge with a new session ID and remembers the session ID
()
| 164 | |
| 165 | // NewSession returns a challenge with a new session ID and remembers the session ID |
| 166 | func (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. |
no test coverage detected