diff --git a/client.go b/client.go index 702cb41..b5da638 100644 --- a/client.go +++ b/client.go @@ -147,9 +147,12 @@ func (c *Client) LoginV1() error { } token := resp.Header.Get(APIAuthHeaderKey) - if token == "" { + if token == "" && cfg.AccessToken == "" { return fmt.Errorf("missing auth token from successful login") } + if cfg.AccessToken != "" { + token = cfg.AccessToken + } c.v1client = v1.New(c.connectionURL, token, cfg.Config.DownloadToken) return nil } diff --git a/types.go b/types.go index 4da7a12..b4acc9e 100644 --- a/types.go +++ b/types.go @@ -1,7 +1,8 @@ package photoprism type Config struct { - Config *Options `json:"config"` + Config *Options `json:"config"` + AccessToken string `json:"access_token"` } type Options struct {