From 603e7e8c6985d0b4b11d7205b929d00f03e8df8e Mon Sep 17 00:00:00 2001 From: Gowtham M Date: Mon, 27 Oct 2025 11:52:30 +0530 Subject: [PATCH] GWM : token fetch --- main.go | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/main.go b/main.go index 93180e7..fce4750 100755 --- a/main.go +++ b/main.go @@ -1727,9 +1727,15 @@ func main() { // Try to find user by UUID (emiratesid) user, err := e.App.Dao().FindFirstRecordByData("users", "emiratesid", requestData.UUID) if err == nil && user != nil { + // Generate auth token for the user + token, tokenErr := e.App.NewRecordAuthToken(user) + if tokenErr != nil { + // log message here + } return c.JSON(http.StatusOK, map[string]interface{}{ "status": "success", "message": "User found by UUID", + "token": token, }) } @@ -1752,10 +1758,17 @@ func main() { }) } + // Generate auth token for the user + token2, tokenErr2 := e.App.NewRecordAuthToken(userByEmail) + if tokenErr2 != nil { + // log message here + } + // Return success after update return c.JSON(http.StatusOK, map[string]interface{}{ "status": "success", "message": "User found by email and UUID updated successfully", + "token": token2, }) })