Spaces:
Configuration error
Configuration error
Download space/controller/user/user_change_password_controller.go from lifedebugger/api-qobiltu-dev: direct link, hf CLI and curl.
- Browser
- Download file 737 Bytes
-
https://huggingface.co/spaces/lifedebugger/api-qobiltu-dev/resolve/main/space/controller/user/user_change_password_controller.go
- Command line
-
hf download hf://spaces/lifedebugger/api-qobiltu-dev/space/controller/user/user_change_password_controller.go
-
curl -L -o user_change_password_controller.go https://huggingface.co/spaces/lifedebugger/api-qobiltu-dev/resolve/main/space/controller/user/user_change_password_controller.go
737 Bytes
| package user | |
| import ( | |
| "api.qobiltu.id/controller" | |
| "api.qobiltu.id/models" | |
| "api.qobiltu.id/services" | |
| "github.com/gin-gonic/gin" | |
| ) | |
| func ChangePassword(c *gin.Context) { | |
| authentication := services.AuthenticationService{} | |
| changePasswordController := controller.Controller[models.ChangePasswordRequest, models.Account, models.AuthenticatedUser]{ | |
| Service: &authentication.Service, | |
| } | |
| changePasswordController.HeaderParse(c, func() { | |
| changePasswordController.Service.Constructor.Id = uint(changePasswordController.AccountData.UserID) | |
| }) | |
| changePasswordController.RequestJSON(c, func() { | |
| authentication.Update(changePasswordController.Request.OldPassword, changePasswordController.Request.NewPassword) | |
| }) | |
| } | |