This commit is contained in:
mats committed 2026-08-27 13:23:31 +02:00
1 parent b16820bf62
commit 938d8d2edb
1 file changed
+3
+3
View File
@@ -315,6 +315,9 @@ func runAuth(ctx context.Context, cfgPath string, cfg *Config, args []string, st
if cfg.AccessToken == "" { if cfg.AccessToken == "" {
return errors.New("no persisted access token; run auth login") return errors.New("no persisted access token; run auth login")
} }
if !cfg.ExpiresAt.IsZero() && !time.Now().Before(cfg.ExpiresAt) {
return fmt.Errorf("persisted access token expired at %s; run auth login", cfg.ExpiresAt.Format(time.RFC3339))
}
if *raw { if *raw {
_, err := fmt.Fprintln(stdout, cfg.AccessToken) _, err := fmt.Fprintln(stdout, cfg.AccessToken)
return err return err