Skip to content

Commit

Permalink
fix zk wallet login (#171)
Browse files Browse the repository at this point in the history
* fix zk wallet login

* Update authenticate.go
  • Loading branch information
Rushikeshnimkar authored May 13, 2024
1 parent 3829824 commit 9f01514
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion api/v1/authenticate/authenticate.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@ func ApplyRoutes(r *gin.RouterGroup) {
g := r.Group("/authenticate")
{
g.POST("", authenticate)
g.POST("/NonSign", authenticateNonSignature)
g.Use(paseto.PASETO(false))
g.GET("", authenticateToken)
g.GET("/nonSign", authenticateNonSignature)
}
}

Expand Down Expand Up @@ -179,6 +179,7 @@ func authenticateNonSignature(c *gin.Context) {
httpo.NewErrorResponse(http.StatusBadRequest, fmt.Sprintf("payload is invalid: %s", err)).SendD(c)
return
}

//Get flowid type
var flowIdData models.FlowId
err = db.Model(&models.FlowId{}).Where("flow_id = ?", req.FlowId).First(&flowIdData).Error
Expand All @@ -187,6 +188,7 @@ func authenticateNonSignature(c *gin.Context) {
httpo.NewErrorResponse(http.StatusNotFound, "flow id not found").SendD(c)
return
}

if flowIdData.FlowIdType != models.AUTH {
httpo.NewErrorResponse(http.StatusBadRequest, "flow id not created for auth").SendD(c)
return
Expand Down

0 comments on commit 9f01514

Please sign in to comment.