mirror of
https://github.com/sstent/go-garth.git
synced 2026-01-26 09:03:00 +00:00
reworked api interfaces
This commit is contained in:
@@ -10,7 +10,7 @@ import (
|
||||
"time"
|
||||
|
||||
"github.com/sstent/go-garth/internal/auth/oauth"
|
||||
types "github.com/sstent/go-garth/internal/models/types"
|
||||
garth "github.com/sstent/go-garth/pkg/garth/types"
|
||||
)
|
||||
|
||||
var (
|
||||
@@ -41,7 +41,7 @@ func NewClient(domain string) *Client {
|
||||
}
|
||||
|
||||
// Login performs the SSO authentication flow
|
||||
func (c *Client) Login(email, password string) (*types.OAuth2Token, *MFAContext, error) {
|
||||
func (c *Client) Login(email, password string) (*garth.OAuth2Token, *MFAContext, error) {
|
||||
fmt.Printf("Logging in to Garmin Connect (%s) using SSO flow...\n", c.Domain)
|
||||
|
||||
scheme := "https"
|
||||
@@ -185,7 +185,7 @@ func (c *Client) Login(email, password string) (*types.OAuth2Token, *MFAContext,
|
||||
}
|
||||
|
||||
// ResumeLogin completes authentication after MFA challenge
|
||||
func (c *Client) ResumeLogin(mfaCode string, ctx *MFAContext) (*types.OAuth2Token, error) {
|
||||
func (c *Client) ResumeLogin(mfaCode string, ctx *MFAContext) (*garth.OAuth2Token, error) {
|
||||
fmt.Println("Resuming login with MFA code...")
|
||||
|
||||
// Submit MFA form
|
||||
|
||||
Reference in New Issue
Block a user