feat: Most of Item and Order controllers
This commit is contained in:
@@ -157,6 +157,7 @@ func IsAuthenticated(auth *auth.Authenticator) gin.HandlerFunc {
|
||||
} else {
|
||||
if !HandleRefreshToken(session) {
|
||||
context.String(http.StatusUnauthorized, "Failed to refresh access token")
|
||||
context.Abort()
|
||||
return
|
||||
} else {
|
||||
context.Next()
|
||||
|
||||
@@ -30,6 +30,7 @@ func UserInDatabase(pool *pgxpool.Pool) gin.HandlerFunc {
|
||||
if query_err != nil {
|
||||
log.Println("UserInDatabase(): ERROR Failed to query for user count")
|
||||
ctx.AbortWithStatus(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
|
||||
if count == 0 {
|
||||
@@ -38,6 +39,7 @@ func UserInDatabase(pool *pgxpool.Pool) gin.HandlerFunc {
|
||||
if exec_err != nil {
|
||||
log.Printf("UserInDatabase(): ERROR Failed to create user... %s", exec_err.Error())
|
||||
ctx.AbortWithStatus(http.StatusInternalServerError)
|
||||
return
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user