aboutsummaryrefslogtreecommitdiff
path: root/auth
diff options
context:
space:
mode:
authorVidhu Kant Sharma <vidhukant@vidhukant.com>2023-09-10 23:06:48 +0530
committerVidhu Kant Sharma <vidhukant@vidhukant.com>2023-09-10 23:06:48 +0530
commita0613bfd790b27f313470bddc08371bcbf54968d (patch)
treeb7be2848305ca84c3e4f9b62a34124b7a84e780c /auth
parentc06a671dc4fe213c0e9f10a99d3c6d82396e91e1 (diff)
actually hashing and comparing passwords (not empty strings)v0.0.9
Diffstat (limited to 'auth')
-rw-r--r--auth/controller.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/auth/controller.go b/auth/controller.go
index 71cdc6a..5b18b64 100644
--- a/auth/controller.go
+++ b/auth/controller.go
@@ -61,6 +61,9 @@ func handleSignUp (ctx *gin.Context) {
return
}
+ // remove password hash from response
+ user.Password = ""
+
ctx.JSON(http.StatusOK, gin.H{
"message": "success",
"data": user,
@@ -114,6 +117,9 @@ func handleSignIn (ctx *gin.Context) {
return
}
+ // remove password hash from response
+ u.Password = ""
+
ctx.JSON(http.StatusOK, gin.H{
"auth_token": authToken,
"refresh_token": refreshToken,