aboutsummaryrefslogtreecommitdiffstats
path: root/fikenauth/oauth.go
diff options
context:
space:
mode:
authorSimen A. W. Olsen <hello@simenandre.no>2026-11-03 22:08:49 +0100
committerSimen A. W. Olsen <hello@simenandre.no>2026-11-03 22:08:49 +0100
commitbef3ccf4521d4ed431f3cdfc66e618c619ce28e4 (patch)
treeef8e6ff90fed4b27d4f2cfd082106f2efdb38ca5 /fikenauth/oauth.go
parenta5491c9dccdf4678bf3b4380d208cf2562afeee4 (diff)
downloadfiken-main.tar.gz
fiken-main.zip
Share one Fiken login between programsHEADv0.4.0main
fikenconfig keeps an OAuth app and a grant per account in ~/.config/fiken, and finds the account that reaches a company. Renewing a grant takes a lock, so programs sharing it take turns.
Diffstat (limited to 'fikenauth/oauth.go')
-rw-r--r--fikenauth/oauth.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/fikenauth/oauth.go b/fikenauth/oauth.go
index f899ccb..79d90ea 100644
--- a/fikenauth/oauth.go
+++ b/fikenauth/oauth.go
@@ -65,19 +65,19 @@ func (e *Error) AccessDenied() bool { return e.Code == "access_denied" }
func (c Config) Validate() error {
var missing []string
if c.ClientID == "" {
- missing = append(missing, "fiken.client_id")
+ missing = append(missing, "client_id")
}
if c.ClientSecret == "" {
- missing = append(missing, "fiken.client_secret_file (or FIKEN_CLIENT_SECRET)")
+ missing = append(missing, "client_secret")
}
if len(missing) > 0 {
return fmt.Errorf(
- "no Fiken OAuth app configured: set %s. Create the app in Fiken under "+
+ "no Fiken OAuth app configured: missing %s. Create the app in Fiken under "+
"Brukerinnstillinger -> API, registering %s as the redirect URL",
strings.Join(missing, " and "), c.redirectURL())
}
if _, err := url.Parse(c.redirectURL()); err != nil {
- return fmt.Errorf("fiken.redirect_url %q is not a URL: %w", c.redirectURL(), err)
+ return fmt.Errorf("redirect URL %q is not a URL: %w", c.redirectURL(), err)
}
return nil
}