Skip to content

Commit

Permalink
prepping for pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
APandamonium1 committed Aug 28, 2024
1 parent cf264fc commit 3b1a6ed
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 18 deletions.
Binary file modified EduSync.exe
Binary file not shown.
17 changes: 9 additions & 8 deletions database.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"fmt"
"log"
"net/http"
"os"
"strings"

firebase "firebase.google.com/go"
Expand All @@ -16,16 +17,16 @@ import (
var firebaseClient *db.Client

func SessionCookie() (string, error) {
sessionCookieStore := goDotEnvVariable("SESSION_COOKIE_STORE")
if sessionCookieStore == "" {
return sessionCookieStore, fmt.Errorf("SESSION_COOKIE_STORE is not set in the environment variables")
}

// sessionCookieStore, found := os.LookupEnv("COOKIESTORE")
// if !found {
// log.Fatalf("COOKIESTORE is not set in the environment variables")
// sessionCookieStore := goDotEnvVariable("SESSION_COOKIE_STORE")
// if sessionCookieStore == "" {
// return sessionCookieStore, fmt.Errorf("SESSION_COOKIE_STORE is not set in the environment variables")
// }

sessionCookieStore, found := os.LookupEnv("COOKIESTORE")
if !found {
log.Fatalf("COOKIESTORE is not set in the environment variables")
}

return sessionCookieStore, nil
}

Expand Down
20 changes: 10 additions & 10 deletions firebase.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ func goDotEnvVariable(key string) string {
func initializeFirebase() error {
ctx := context.Background()

// databaseURL, found := os.LookupEnv("DATABASE_URL")
// if !found {
// log.Fatalf("DATABASE_URL is not set in the environment variables")
// }
// opt := option.WithCredentialsFile("edusync-7bd5e-firebase-adminsdk-x49uh-af084a6314.json")

databaseURL := goDotEnvVariable("DATABASE_URL")
if databaseURL == "" {
return fmt.Errorf("DATABASE_URL is not set in the environment variables")
databaseURL, found := os.LookupEnv("DATABASE_URL")
if !found {
log.Fatalf("DATABASE_URL is not set in the environment variables")
}
opt := option.WithCredentialsFile("edusync-test-firebase-adminsdk-hk5kl-9af0162b09.json")
opt := option.WithCredentialsFile("edusync-7bd5e-firebase-adminsdk-x49uh-af084a6314.json")

// databaseURL := goDotEnvVariable("DATABASE_URL")
// if databaseURL == "" {
// return fmt.Errorf("DATABASE_URL is not set in the environment variables")
// }
// opt := option.WithCredentialsFile("edusync-test-firebase-adminsdk-hk5kl-9af0162b09.json")

conf := &firebase.Config{DatabaseURL: databaseURL}

Expand Down
1 change: 1 addition & 0 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ require (
github.com/google/uuid v1.6.0
github.com/gorilla/mux v1.8.1
github.com/gorilla/sessions v1.3.0
github.com/joho/godotenv v1.5.1
github.com/markbates/goth v1.80.0
golang.org/x/oauth2 v0.21.0
google.golang.org/api v0.189.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,8 @@ github.com/gorilla/securecookie v1.1.2 h1:YCIWL56dvtr73r6715mJs5ZvhtnY73hBvEF8kX
github.com/gorilla/securecookie v1.1.2/go.mod h1:NfCASbcHqRSY+3a8tlWJwsQap2VX5pwzwo4h3eOamfo=
github.com/gorilla/sessions v1.3.0 h1:XYlkq7KcpOB2ZhHBPv5WpjMIxrQosiZanfoy1HLZFzg=
github.com/gorilla/sessions v1.3.0/go.mod h1:ePLdVu+jbEgHH+KWw8I1z2wqd0BAdAQh/8LRvBeoNcQ=
github.com/joho/godotenv v1.5.1 h1:7eLL/+HRGLY0ldzfGMeQkb7vMd0as4CfYvUVzLqw0N0=
github.com/joho/godotenv v1.5.1/go.mod h1:f4LDr5Voq0i2e/R5DDNOoa2zzDfwtkZa6DnEwAbqwq4=
github.com/markbates/goth v1.80.0 h1:NnvatczZDzOs1hn9Ug+dVYf2Viwwkp/ZDX5K+GLjan8=
github.com/markbates/goth v1.80.0/go.mod h1:4/GYHo+W6NWisrMPZnq0Yr2Q70UntNLn7KXEFhrIdAY=
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
Expand Down

0 comments on commit 3b1a6ed

Please sign in to comment.