Auth Flow Work
Go update too
This commit is contained in:
@@ -165,7 +165,9 @@ func (s *ScreenHome) HandleResize(ev *tcell.EventResize) {
|
||||
|
||||
func (s *ScreenHome) HandleKey(ev *tcell.EventKey) bool {
|
||||
if s.showAlert {
|
||||
return s.alert.HandleKey(ev)
|
||||
handled := s.alert.HandleKey(ev)
|
||||
s.alert.SetMessage(fmt.Sprintf("Alert Handled? %v -> %s", handled, ev.Name()))
|
||||
return handled
|
||||
}
|
||||
if ev.Key() == tcell.KeyF12 {
|
||||
s.toggleCli()
|
||||
@@ -390,6 +392,8 @@ func (s *ScreenHome) cliAuthPds(args ...string) bool {
|
||||
}
|
||||
s.alert.SetTitle("Authentication Started")
|
||||
s.alert.SetMessage(fmt.Sprintf("OAuth Process Started.\nIf a browser window didn't open, you can open this URL manually:\n%s", authUrl))
|
||||
s.alert.SetVisible(true)
|
||||
s.alert.SetActive(true)
|
||||
s.showAlert = true
|
||||
}()
|
||||
return true
|
||||
@@ -443,7 +447,7 @@ func (s *ScreenHome) updatePdsListing() {
|
||||
if viper.GetBool(data.KeyRecNmInfer) {
|
||||
if rec, ok := s.activePds.Records[rIds[j]]; ok {
|
||||
for k := range rec {
|
||||
if k == "name" || k == "title" || k == "label" {
|
||||
if k == "name" || k == "title" || k == "label" || k == "displayName" {
|
||||
if f, ok := rec[k].(string); ok {
|
||||
label = fmt.Sprintf("%s (%s)", f, rIds[j])
|
||||
break
|
||||
|
||||
@@ -24,6 +24,7 @@ type AuthRepo struct {
|
||||
context context.Context
|
||||
|
||||
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
|
||||
}
|
||||
|
||||
|
||||
4
go.mod
4
go.mod
@@ -1,6 +1,8 @@
|
||||
module git.bullercodeworks.com/brian/expds
|
||||
|
||||
go 1.25.1
|
||||
go 1.26.0
|
||||
|
||||
replace git.bullercodeworks.com/brian/tcell-widgets => /home/brbuller/Development/go/src/git.bullercodeworks.com/brian/tcell-widgets
|
||||
|
||||
require (
|
||||
git.bullercodeworks.com/brian/tcell-widgets v0.3.2
|
||||
|
||||
@@ -165,7 +165,15 @@ func (w *JsonContent) Draw(screen tcell.Screen) {
|
||||
txt = txt[:(w.w - brdSz)]
|
||||
}
|
||||
|
||||
if w.editable {
|
||||
var key, val string
|
||||
|
||||
wh.DrawText(w.x, y, key, st.Dim(dim).Bold(!dim), screen)
|
||||
st = st.Reverse(true)
|
||||
wh.DrawText(w.x, y, val, st.Dim(dim).Bold(!dim), screen)
|
||||
} else {
|
||||
wh.DrawText(w.x, y, txt, st.Dim(dim).Bold(!dim), screen)
|
||||
}
|
||||
y++
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user