UPDATE: Historian module
All checks were successful
Build and Release / release (push) Successful in 1m20s
All checks were successful
Build and Release / release (push) Successful in 1m20s
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user