fix: switch to fmt.Printf
This commit is contained in:
+4
-3
@@ -3,6 +3,7 @@ package routes
|
|||||||
import (
|
import (
|
||||||
"crypto/rand"
|
"crypto/rand"
|
||||||
"encoding/hex"
|
"encoding/hex"
|
||||||
|
"fmt"
|
||||||
|
|
||||||
"github.com/gofiber/fiber/v2"
|
"github.com/gofiber/fiber/v2"
|
||||||
"github.com/imroc/req/v3"
|
"github.com/imroc/req/v3"
|
||||||
@@ -44,7 +45,7 @@ func GETOAuthCallback(c *fiber.Ctx) error {
|
|||||||
}).SetSuccessResult(&accessTokenResult).Post("https://discord.com/api/oauth2/token")
|
}).SetSuccessResult(&accessTokenResult).Post("https://discord.com/api/oauth2/token")
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Context().Logger().Printf("Failed to request access token: %v", err)
|
fmt.Printf("Failed to request access token: %v", err)
|
||||||
return c.Status(500).JSON(&fiber.Map{
|
return c.Status(500).JSON(&fiber.Map{
|
||||||
"error": "Failed to request access token",
|
"error": "Failed to request access token",
|
||||||
})
|
})
|
||||||
@@ -65,7 +66,7 @@ func GETOAuthCallback(c *fiber.Ctx) error {
|
|||||||
}).SetSuccessResult(&userResult).Get("https://discord.com/api/users/@me")
|
}).SetSuccessResult(&userResult).Get("https://discord.com/api/users/@me")
|
||||||
|
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Context().Logger().Printf("Failed to request user: %v", err)
|
fmt.Printf("Failed to request user: %v", err)
|
||||||
return c.Status(500).JSON(&fiber.Map{
|
return c.Status(500).JSON(&fiber.Map{
|
||||||
"error": "Failed to request user",
|
"error": "Failed to request user",
|
||||||
})
|
})
|
||||||
@@ -92,7 +93,7 @@ func GETOAuthCallback(c *fiber.Ctx) error {
|
|||||||
|
|
||||||
_, err := rand.Read(key)
|
_, err := rand.Read(key)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
c.Context().Logger().Printf("Failed to generate secret: %v", err)
|
fmt.Printf("Failed to generate secret: %v", err)
|
||||||
return c.Status(500).JSON(&fiber.Map{
|
return c.Status(500).JSON(&fiber.Map{
|
||||||
"error": "Failed to generate secret",
|
"error": "Failed to generate secret",
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user