mirror of
https://github.com/Rain-kl/OpenFlare.git
synced 2026-10-10 17:26:38 +08:00
chore(cordis): sync Wavelet core/pkg/plugins after W1-W9
This commit is contained in:
@@ -200,6 +200,22 @@ func ChangePassword(c *gin.Context) {
|
||||
c.JSON(http.StatusOK, response.OKNil())
|
||||
}
|
||||
|
||||
// Self returns the current authenticated user.
|
||||
func Self(c *gin.Context) {
|
||||
svc := getAuthService()
|
||||
if svc == nil {
|
||||
response.AbortUnauthorized(c, errUserNotFound)
|
||||
return
|
||||
}
|
||||
user, err := svc.GetCurrentUser(c)
|
||||
if err != nil {
|
||||
logger.ErrorF(c.Request.Context(), "get current user failed: %v", err)
|
||||
response.AbortUnauthorized(c, errUserNotFound)
|
||||
return
|
||||
}
|
||||
c.JSON(http.StatusOK, response.OK(user))
|
||||
}
|
||||
|
||||
// UpdateProfile updates profile info.
|
||||
func UpdateProfile(c *gin.Context) {
|
||||
var req updateProfileRequest
|
||||
|
||||
Reference in New Issue
Block a user