main v2.0.0
Astra 2024-05-27 17:58:30 +01:00
parent 39ebac8aa4
commit 46591ba762
2 changed files with 6 additions and 2 deletions

View File

@ -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
}

View File

@ -2,6 +2,7 @@ package photoprism
type Config struct {
Config *Options `json:"config"`
AccessToken string `json:"access_token"`
}
type Options struct {