Auth Flow Work

Go update too
This commit is contained in:
2026-02-12 06:12:21 -06:00
parent 687e64e701
commit cda564d5cc
4 changed files with 24 additions and 11 deletions

View File

@@ -23,7 +23,8 @@ type AuthRepo struct {
store *SqliteStore
context context.Context
session *oauth.ClientSessionData
session *oauth.ClientSessionData
authError error
}
func NewAuthRepo(r *Repo) (*AuthRepo, error) {
@@ -70,12 +71,10 @@ func (r *AuthRepo) StartAuthFlow(port int, identifier string, callbackRes chan u
if !strings.HasPrefix(authUrl, "https://") {
return "", fmt.Errorf("non-https authUrl")
}
exec.Command("xdg-open", authUrl).Run()
r.session, err = r.oauthClient.ProcessCallback(r.context, <-callbackRes)
if err != nil {
return "", err
}
go func() {
exec.Command("xdg-open", authUrl).Start()
r.session, r.authError = r.oauthClient.ProcessCallback(r.context, <-callbackRes)
}()
return authUrl, nil
}