diff --git a/internal/app/server/server.go b/internal/app/server/server.go
index c891e49..7f3e608 100644
--- a/internal/app/server/server.go
+++ b/internal/app/server/server.go
@@ -58,8 +58,10 @@ func (s *Server) ConfigureAuth() *Server {
panic("Could not load env file")
}
+ redirect_domain := os.Getenv("DOMAIN")
+
var (
- redirectUrl string = "http://localhost:3000/v1/api/auth/callback"
+ redirectUrl string = fmt.Sprintf("%s%s", redirect_domain, domain.API_AUTH_CALLBACK)
clientId string = os.Getenv("GOOGLE_CLIENT_ID")
clientSecret string = os.Getenv("GOOGLE_CLIENT_SECRET")
scope []string = []string{
diff --git a/internal/domain/server/routes.go b/internal/domain/server/routes.go
index 2e7d279..48c96a6 100644
--- a/internal/domain/server/routes.go
+++ b/internal/domain/server/routes.go
@@ -2,19 +2,19 @@ package domain
// Sub-routes
const VERSION = "/v1"
-const WEB = VERSION + "/web"
-const API = VERSION + "/api"
+const WEB = "/web"
+const API = "/api"
// Web prefixed routes
-const WEB_LOGIN = WEB + "/login"
-const WEB_INDEX = WEB
-const WEB_HOME = WEB + "/home"
-const WEB_FAVORITES = WEB + "/favorites"
-const WEB_CREATE = WEB + "/create"
-const WEB_PROFIlE = WEB + "/profile"
-const WEB_LIST = WEB + "/list"
+const WEB_LOGIN = VERSION + WEB + "/login"
+const WEB_INDEX = VERSION + WEB
+const WEB_HOME = VERSION + WEB + "/home"
+const WEB_FAVORITES = VERSION + WEB + "/favorites"
+const WEB_CREATE = VERSION + WEB + "/create"
+const WEB_PROFIlE = VERSION + WEB + "/profile"
+const WEB_LIST = VERSION + WEB + "/list"
// API prefixed routes
-const API_AUTH_LOGIN = API + "/auth/login"
-const API_AUTH_CALLBACK = API + "/auth/callback"
-const API_AUTH_LOGOUT = API + "/auth/logout"
+const API_AUTH_LOGIN = VERSION + API + "/auth/login"
+const API_AUTH_CALLBACK = VERSION + API + "/auth/callback"
+const API_AUTH_LOGOUT = VERSION + API + "/auth/logout"
diff --git a/internal/templates/components/navbar_templ.go b/internal/templates/components/navbar_templ.go
index f04ba9d..d2a2eef 100644
--- a/internal/templates/components/navbar_templ.go
+++ b/internal/templates/components/navbar_templ.go
@@ -9,6 +9,7 @@ import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
import "strings"
+import "github.com/haydenhargreaves/Potion/internal/domain/server"
func hamburgerMenu() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
@@ -35,23 +36,23 @@ func hamburgerMenu() templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = dropdownLink("Home", "/v1/web/home").Render(ctx, templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = dropdownLink("Home", domain.WEB_HOME).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = dropdownLink("Favorites", "/v1/web/favorites").Render(ctx, templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = dropdownLink("Favorites", domain.WEB_FAVORITES).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = dropdownLink("Create", "/v1/web/create").Render(ctx, templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = dropdownLink("Create", domain.WEB_CREATE).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = dropdownLink("Profile", "/v1/web/profile").Render(ctx, templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = dropdownLink("Profile", domain.WEB_PROFIlE).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = dropdownLink("Shopping List", "/v1/web/list").Render(ctx, templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = dropdownLink("Shopping List", domain.WEB_LIST).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
@@ -91,7 +92,7 @@ func navLink(current, name, url string) templ.Component {
var templ_7745c5c3_Var3 templ.SafeURL
templ_7745c5c3_Var3, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(url))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/templates/components/navbar.templ`, Line: 38, Col: 28}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/templates/components/navbar.templ`, Line: 39, Col: 28}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var3))
if templ_7745c5c3_Err != nil {
@@ -119,7 +120,7 @@ func navLink(current, name, url string) templ.Component {
var templ_7745c5c3_Var4 string
templ_7745c5c3_Var4, templ_7745c5c3_Err = templ.JoinStringErrs(name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/templates/components/navbar.templ`, Line: 41, Col: 8}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/templates/components/navbar.templ`, Line: 42, Col: 8}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var4))
if templ_7745c5c3_Err != nil {
@@ -161,7 +162,7 @@ func dropdownLink(name, url string) templ.Component {
var templ_7745c5c3_Var6 templ.SafeURL
templ_7745c5c3_Var6, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(url))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/templates/components/navbar.templ`, Line: 46, Col: 41}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/templates/components/navbar.templ`, Line: 47, Col: 41}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var6))
if templ_7745c5c3_Err != nil {
@@ -174,7 +175,7 @@ func dropdownLink(name, url string) templ.Component {
var templ_7745c5c3_Var7 string
templ_7745c5c3_Var7, templ_7745c5c3_Err = templ.JoinStringErrs(name)
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/templates/components/navbar.templ`, Line: 47, Col: 8}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/templates/components/navbar.templ`, Line: 48, Col: 8}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var7))
if templ_7745c5c3_Err != nil {
@@ -216,7 +217,7 @@ func listIcon(current, name, url string) templ.Component {
var templ_7745c5c3_Var9 templ.SafeURL
templ_7745c5c3_Var9, templ_7745c5c3_Err = templ.JoinURLErrs(templ.SafeURL(url))
if templ_7745c5c3_Err != nil {
- return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/templates/components/navbar.templ`, Line: 52, Col: 28}
+ return templ.Error{Err: templ_7745c5c3_Err, FileName: `internal/templates/components/navbar.templ`, Line: 53, Col: 28}
}
_, templ_7745c5c3_Err = templ_7745c5c3_Buffer.WriteString(templ.EscapeString(templ_7745c5c3_Var9))
if templ_7745c5c3_Err != nil {
@@ -270,23 +271,23 @@ func Navbar(current string) templ.Component {
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = navLink(current, "Home", "/v1/web/home").Render(ctx, templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = navLink(current, "Home", domain.WEB_HOME).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = navLink(current, "Favorites", "/v1/web/favorites").Render(ctx, templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = navLink(current, "Favorites", domain.WEB_FAVORITES).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = navLink(current, "Create", "/v1/web/create").Render(ctx, templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = navLink(current, "Create", domain.WEB_CREATE).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = navLink(current, "Profile", "/v1/web/profile").Render(ctx, templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = navLink(current, "Profile", domain.WEB_PROFIlE).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
- templ_7745c5c3_Err = listIcon(current, "List", "/v1/web/list").Render(ctx, templ_7745c5c3_Buffer)
+ templ_7745c5c3_Err = listIcon(current, "List", domain.WEB_LIST).Render(ctx, templ_7745c5c3_Buffer)
if templ_7745c5c3_Err != nil {
return templ_7745c5c3_Err
}
diff --git a/internal/templates/pages/home_templ.go b/internal/templates/pages/home_templ.go
index 6dd1a3e..fc5fac4 100644
--- a/internal/templates/pages/home_templ.go
+++ b/internal/templates/pages/home_templ.go
@@ -9,6 +9,7 @@ import "github.com/a-h/templ"
import templruntime "github.com/a-h/templ/runtime"
import "github.com/haydenhargreaves/Potion/internal/templates/components"
+import "github.com/haydenhargreaves/Potion/internal/domain/server"
func introSection() templ.Component {
return templruntime.GeneratedTemplate(func(templ_7745c5c3_Input templruntime.GeneratedComponentInput) (templ_7745c5c3_Err error) {
@@ -313,7 +314,20 @@ func ctaSection() templ.Component {
templ_7745c5c3_Var7 = templ.NopComponent
}
ctx = templ.ClearChildren(ctx)
- templ_7745c5c3_Err = templruntime.WriteString(templ_7745c5c3_Buffer, 15, " Have a unique recipe idea? Want to share your culinary masterpiece with the world? It's time to bring your creations to life! Have a unique recipe idea? Want to share your culinary masterpiece with the world? It's time to bring your creations to life!Unleash Your Inner Chef!
Unleash Your Inner Chef!
You need to sign in to continue. Don't have an account? Signing in will create one for you!
You need to sign in to continue. Don't have an account? Signing in will create one for you!