Skip to content

Commit db73c56

Browse files
committed
fix: review comments
1 parent 4a85a9d commit db73c56

3 files changed

Lines changed: 2 additions & 7 deletions

File tree

internal/controller/oauth_controller.go

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,6 @@ func (controller *OAuthController) oauthURLHandler(c *gin.Context) {
7373
return
7474
}
7575

76-
tlog.App.Debug().Interface("session", session).Msg("Created new OAuth session")
77-
7876
authUrl, err := controller.auth.GetOAuthURL(sessionId)
7977

8078
if err != nil {
@@ -145,8 +143,6 @@ func (controller *OAuthController) oauthCallbackHandler(c *gin.Context) {
145143
c.SetCookie(controller.config.CSRFCookieName, "", -1, "/", fmt.Sprintf(".%s", controller.config.CookieDomain), controller.config.SecureCookie, true)
146144

147145
code := c.Query("code")
148-
149-
tlog.App.Debug().Str("code", code).Str("state", state).Msg("Received OAuth callback")
150146
_, err = controller.auth.GetOAuthToken(sessionIdCookie, code)
151147

152148
if err != nil {

internal/service/auth_service.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -671,7 +671,6 @@ func (auth *AuthService) CleanupOAuthSessionsRoutine() {
671671

672672
for range ticker.C {
673673
auth.oauthMutex.Lock()
674-
defer auth.oauthMutex.Unlock()
675674

676675
now := time.Now()
677676

@@ -680,6 +679,8 @@ func (auth *AuthService) CleanupOAuthSessionsRoutine() {
680679
delete(auth.oauthPendingSessions, sessionId)
681680
}
682681
}
682+
683+
auth.oauthMutex.Unlock()
683684
}
684685
}
685686

internal/service/oauth_service.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ import (
77
"time"
88

99
"github.com/steveiliop56/tinyauth/internal/config"
10-
"github.com/steveiliop56/tinyauth/internal/utils/tlog"
1110
"golang.org/x/oauth2"
1211
)
1312

@@ -70,7 +69,6 @@ func (s *OAuthService) GetAuthURL(state string, verifier string) string {
7069
}
7170

7271
func (s *OAuthService) GetToken(code string, verifier string) (*oauth2.Token, error) {
73-
tlog.App.Debug().Str("code", code).Str("verifier", verifier).Msg("Exchanging code for token")
7472
return s.config.Exchange(s.ctx, code, oauth2.VerifierOption(verifier))
7573
}
7674

0 commit comments

Comments
 (0)