Skip to content

Commit bd7f20c

Browse files
authored
fix: Update session (#23)
1 parent f59f2d6 commit bd7f20c

File tree

3 files changed

+4
-4
lines changed

3 files changed

+4
-4
lines changed

internal/auth/github.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func (h *GitHubHandler) HandleCallback(ctx *gin.Context) {
6565
}
6666

6767
// Store user session
68-
session, err := gothic.Store.New(ctx.Request, h.sessionSecret)
68+
session, err := gothic.Store.New(ctx.Request, "trakrlog-session")
6969
if err != nil {
7070
ctx.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{
7171
"success": false,

internal/auth/google.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ func (h *GoogleHandler) HandleCallback(ctx *gin.Context) {
6565
}
6666

6767
// Store user session
68-
session, err := gothic.Store.New(ctx.Request, h.sessionSecret)
68+
session, err := gothic.Store.New(ctx.Request, "trakrlog-session")
6969
if err != nil {
7070
ctx.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{
7171
"success": false,
@@ -92,7 +92,7 @@ func (h *GoogleHandler) HandleCallback(ctx *gin.Context) {
9292

9393
func (h *GoogleHandler) GetAuthUser(ctx *gin.Context) {
9494
// Retrieve the session
95-
session, err := gothic.Store.Get(ctx.Request, h.sessionSecret)
95+
session, err := gothic.Store.Get(ctx.Request, "trakrlog-session")
9696
if err != nil {
9797
ctx.AbortWithStatusJSON(http.StatusInternalServerError, gin.H{
9898
"success": false,

internal/middleware/auth.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import (
1313
func RequireAuth(sessionSecret string) gin.HandlerFunc {
1414
return func(ctx *gin.Context) {
1515
// Retrieve the session
16-
session, err := gothic.Store.Get(ctx.Request, sessionSecret)
16+
session, err := gothic.Store.Get(ctx.Request, "trakrlog-session")
1717
if err != nil {
1818
ctx.AbortWithStatusJSON(http.StatusUnauthorized, gin.H{
1919
"success": false,

0 commit comments

Comments
 (0)