UPDATE: Historian module
All checks were successful
Build and Release / release (push) Successful in 1m20s

This commit is contained in:
2026-04-12 00:35:14 +07:00
parent af76d2a26a
commit 03415782d1
38 changed files with 2759 additions and 231 deletions

View File

@@ -8,6 +8,7 @@ import (
"history-api/internal/dtos/response"
"history-api/internal/models"
"history-api/internal/services"
"history-api/pkg/config"
"history-api/pkg/validator"
"strings"
"time"
@@ -137,7 +138,6 @@ func (h *AuthController) Signup(c fiber.Ctx) error {
})
}
func (h *AuthController) getRefreshToken(c fiber.Ctx) string {
auth := c.Get("Authorization")
if auth != "" {
@@ -326,9 +326,10 @@ func (h *AuthController) GoogleLogin(c fiber.Ctx) error {
state := uuid.New().String()
feUrl := config.GetConfigWithDefault("FRONTEND_URL", "http://localhost:3000")
redirect := c.Query("redirect")
if redirect == "" {
redirect = "http://localhost:3000"
redirect = feUrl
}
data := models.OAuthState{
@@ -443,10 +444,10 @@ func (h *AuthController) GoogleCallback(c fiber.Ctx) error {
"https://localhost:3001": true,
"http://localhost:5500": true,
}
feUrl := config.GetConfigWithDefault("FRONTEND_URL", "http://localhost:3000")
redirectURL := data.RedirectURL
if !allowed[redirectURL] {
redirectURL = "http://localhost:3000"
redirectURL = feUrl
}
return c.Redirect().To(redirectURL)