feat: move oauth logic into auth service and handle multiple sessions

This commit is contained in:
Stavros
2026-03-21 16:37:04 +02:00
parent 2491d453cf
commit 7bead41ae9
8 changed files with 169 additions and 160 deletions

View File

@@ -7,6 +7,7 @@ import (
"time"
"github.com/steveiliop56/tinyauth/internal/config"
"github.com/steveiliop56/tinyauth/internal/utils/tlog"
"golang.org/x/oauth2"
)
@@ -69,6 +70,7 @@ func (s *OAuthService) GetAuthURL(state string, verifier string) string {
}
func (s *OAuthService) GetToken(code string, verifier string) (*oauth2.Token, error) {
tlog.App.Debug().Str("code", code).Str("verifier", verifier).Msg("Exchanging code for token")
return s.config.Exchange(s.ctx, code, oauth2.VerifierOption(verifier))
}