From 91b1301fb302d31eed48917acfdcd64d2e2ae538 Mon Sep 17 00:00:00 2001 From: Stephanie Gredell Date: Sat, 16 Nov 2024 04:10:57 -0500 Subject: [PATCH] add back in the cookie store so auth doesn't break again --- main.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/main.go b/main.go index 48e677c..537bbc1 100644 --- a/main.go +++ b/main.go @@ -2,12 +2,15 @@ package main import ( "github.com/gin-gonic/gin" + "github.com/gorilla/sessions" "github.com/joho/godotenv" "github.com/markbates/goth" + "github.com/markbates/goth/gothic" "github.com/markbates/goth/providers/twitch" "log" "os" "sponsorahacker/auth" + "sponsorahacker/config" "sponsorahacker/pages" ) @@ -23,6 +26,8 @@ func main() { log.Fatal("Error loading .env file") } + sessionSecret := config.GetEnvVar("SESSION_SECRET") + gothic.Store = sessions.NewCookieStore([]byte(sessionSecret)) goth.UseProviders( twitch.New(os.Getenv("TWITCH_CLIENT_ID"), os.Getenv("TWITCH_SECRET"), "http://localhost:8080/auth/twitch/callback"), // google.New(os.Getenv("GOOGLE_CLIENT_ID"), os.Getenv("GOOGLE_SECRET"), "http://localhost:8080/auth/google/callback"),