Compare commits
No commits in common. "4946b7e5959f02cfdd5b0a7b539f7b51b8b17578" and "ca9e41e99eaa5dd047e9c24a72cff1cdfb7b357f" have entirely different histories.
4946b7e595
...
ca9e41e99e
@ -56,8 +56,6 @@ func (a *App) CheckPrerequisites() {
|
|||||||
a.Auth, err = TokenRefresh(*a, a.Auth)
|
a.Auth, err = TokenRefresh(*a, a.Auth)
|
||||||
if err == nil {
|
if err == nil {
|
||||||
authenticated = true
|
authenticated = true
|
||||||
} else {
|
|
||||||
fmt.Printf("token reauth failed, requesting device code: %s\n", err)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if !authenticated {
|
if !authenticated {
|
||||||
|
@ -12,6 +12,7 @@ import (
|
|||||||
wruntime "github.com/wailsapp/wails/v2/pkg/runtime"
|
wruntime "github.com/wailsapp/wails/v2/pkg/runtime"
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
type LauncherAuth struct {
|
type LauncherAuth struct {
|
||||||
Id string
|
Id string
|
||||||
Name string
|
Name string
|
||||||
@ -149,9 +150,6 @@ func TokenRefresh(app App, auth authenticationResp) (authenticationResp, error)
|
|||||||
data, _ := io.ReadAll(resp.Body)
|
data, _ := io.ReadAll(resp.Body)
|
||||||
authResp := authenticationResp{}
|
authResp := authenticationResp{}
|
||||||
json.Unmarshal(data, &authResp)
|
json.Unmarshal(data, &authResp)
|
||||||
if authResp.Error != "" {
|
|
||||||
return authResp, fmt.Errorf("unable to request new token: %s", authResp.Error_description)
|
|
||||||
}
|
|
||||||
return authResp, nil
|
return authResp, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user