diff options
| author | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2022-10-26 01:04:21 +0300 |
|---|---|---|
| committer | Arda Serdar Pektezol <1669855+pektezol@users.noreply.github.com> | 2022-10-26 01:04:21 +0300 |
| commit | 4fae4ef6e7f51385fcfaa416f3518d2adf5297f9 (patch) | |
| tree | 98aadeea5e448ea2dec8825fa3bc3578077bfd50 | |
| parent | change env key retrieve method (diff) | |
| download | lphub-4fae4ef6e7f51385fcfaa416f3518d2adf5297f9.tar.gz lphub-4fae4ef6e7f51385fcfaa416f3518d2adf5297f9.tar.bz2 lphub-4fae4ef6e7f51385fcfaa416f3518d2adf5297f9.zip | |
change env key retrieve method
| -rw-r--r-- | backend/routes/routes.go | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/backend/routes/routes.go b/backend/routes/routes.go index 065d0b6..8bdd65d 100644 --- a/backend/routes/routes.go +++ b/backend/routes/routes.go | |||
| @@ -1,6 +1,8 @@ | |||
| 1 | package routes | 1 | package routes |
| 2 | 2 | ||
| 3 | import ( | 3 | import ( |
| 4 | "os" | ||
| 5 | |||
| 4 | "github.com/gin-contrib/sessions" | 6 | "github.com/gin-contrib/sessions" |
| 5 | "github.com/gin-contrib/sessions/cookie" | 7 | "github.com/gin-contrib/sessions/cookie" |
| 6 | "github.com/gin-gonic/gin" | 8 | "github.com/gin-gonic/gin" |
| @@ -8,7 +10,7 @@ import ( | |||
| 8 | ) | 10 | ) |
| 9 | 11 | ||
| 10 | func InitRoutes(router *gin.Engine) { | 12 | func InitRoutes(router *gin.Engine) { |
| 11 | store := cookie.NewStore([]byte(controllers.GetEnvKey("SESSION_KEY"))) | 13 | store := cookie.NewStore([]byte(os.Getenv("SESSION_KEY"))) |
| 12 | router.Use(sessions.Sessions("session", store)) | 14 | router.Use(sessions.Sessions("session", store)) |
| 13 | api := router.Group("/api") | 15 | api := router.Group("/api") |
| 14 | { | 16 | { |