(c *gin.Context)
| 342 | } |
| 343 | |
| 344 | func getUserInfo(c *gin.Context) { |
| 345 | projectDB, err := getCurrentProjectDB(c) |
| 346 | if err != nil { |
| 347 | _ = c.Error(err) |
| 348 | abortWithError(c, http.StatusBadRequest, ErrLoadProjectDatabaseFailed) |
| 349 | return |
| 350 | } |
| 351 | |
| 352 | userID := getUserID(c) |
| 353 | u, err := model.GetProjectUser(projectDB, userID) |
| 354 | if err != nil { |
| 355 | _ = c.Error(err) |
| 356 | abortWithError(c, http.StatusForbidden, ErrGetProjectUserFailed) |
| 357 | return |
| 358 | } |
| 359 | |
| 360 | responseWithData(c, http.StatusOK, gin.H{ |
| 361 | "name": u.Name, |
| 362 | "email": u.Email, |
| 363 | "extra": u.Extra, |
| 364 | "provider": u.Provider, |
| 365 | "provide_id": u.ProviderUID, |
| 366 | }) |
| 367 | } |
| 368 | |
| 369 | func userAuthLogout(c *gin.Context) { |
| 370 | err := model.DeleteSession(model.GetDB(c), getSession(c)) |
nothing calls this directly
no test coverage detected