Skip to content

Commit

Permalink
Merge branch 'main' into 850-feat-use-contextcontext
Browse files Browse the repository at this point in the history
  • Loading branch information
garrettladley authored May 20, 2024
2 parents 21c633c + 21ae854 commit a2cb032
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 3 deletions.
2 changes: 1 addition & 1 deletion backend/entities/auth/base/controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ func (a *AuthController) Refresh(c *fiber.Ctx) error {
var refreshBody RefreshTokenCookieBody

if err := c.CookieParser(&refreshBody); err != nil {
return utilities.InvalidJSON()
return utilities.InvalidCookies()
}

ctx, cancel := context.WithTimeout(c.Context(), constants.HANDLER_TIMEOUT)
Expand Down
4 changes: 4 additions & 0 deletions backend/utilities/api_error.go
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,10 @@ func InvalidJSON() APIError {
return NewAPIError(http.StatusBadRequest, fmt.Errorf("invalid JSON request data"))
}

func InvalidCookies() APIError {
return NewAPIError(http.StatusBadRequest, fmt.Errorf("invalid cookies"))
}

func Unauthorized() APIError {
return NewAPIError(http.StatusUnauthorized, fmt.Errorf("unauthorized"))
}
Expand Down
4 changes: 2 additions & 2 deletions cli/cmd/test.go
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ var testBackendCmd = &cobra.Command{
Run: func(cmd *cobra.Command, args []string) {
clear, _ := cmd.Flags().GetBool("clean")

err := helpers.Execute(exec.Command("go", "test", "./..."), helpers.BACKEND_DIR)
err := helpers.Execute(exec.Command("go", "test", "-v", "-race", "./..."), helpers.BACKEND_DIR)
if err != nil {
fmt.Println(err)
}
Expand All @@ -120,7 +120,7 @@ var testCliCmd = &cobra.Command{
Short: "CLI testing commands",
Args: cobra.NoArgs,
Run: func(cmd *cobra.Command, args []string) {
err := helpers.Execute(exec.Command("go", "test", "./..."), helpers.CLI_DIR)
err := helpers.Execute(exec.Command("go", "test", "-v", "-race", "./..."), helpers.CLI_DIR)
if err != nil {
fmt.Println(err)
os.Exit(1)
Expand Down

0 comments on commit a2cb032

Please sign in to comment.