Auth Flow Work
Go update too
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user