File tree Expand file tree Collapse file tree 1 file changed +6
-1
lines changed
Expand file tree Collapse file tree 1 file changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -916,8 +916,12 @@ func main() {
916916
917917 // Update username
918918 router .POST ("/users/me/username" , func (c * gin.Context ) {
919- userID , _ := c .Get ("user_id" )
919+ log .Printf ("=== Username change endpoint hit ===" )
920+ userID , exists := c .Get ("user_id" )
921+ log .Printf ("user_id from context: %v, exists: %v" , userID , exists )
922+
920923 if userID == nil {
924+ log .Printf ("Unauthorized: user_id is nil" )
921925 c .JSON (http .StatusUnauthorized , gin.H {"error" : "Unauthorized" })
922926 return
923927 }
@@ -926,6 +930,7 @@ func main() {
926930 NewUsername string `json:"new_username"`
927931 }
928932 if err := c .BindJSON (& req ); err != nil {
933+ log .Printf ("Failed to bind JSON: %v" , err )
929934 c .JSON (http .StatusBadRequest , gin.H {"error" : err .Error ()})
930935 return
931936 }
You can’t perform that action at this time.
0 commit comments