Misc
This commit is contained in:
parent
39ebac8aa4
commit
46591ba762
2 changed files with 6 additions and 2 deletions
|
@ -147,9 +147,12 @@ func (c *Client) LoginV1() error {
|
||||||
}
|
}
|
||||||
|
|
||||||
token := resp.Header.Get(APIAuthHeaderKey)
|
token := resp.Header.Get(APIAuthHeaderKey)
|
||||||
if token == "" {
|
if token == "" && cfg.AccessToken == "" {
|
||||||
return fmt.Errorf("missing auth token from successful login")
|
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)
|
c.v1client = v1.New(c.connectionURL, token, cfg.Config.DownloadToken)
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
3
types.go
3
types.go
|
@ -1,7 +1,8 @@
|
||||||
package photoprism
|
package photoprism
|
||||||
|
|
||||||
type Config struct {
|
type Config struct {
|
||||||
Config *Options `json:"config"`
|
Config *Options `json:"config"`
|
||||||
|
AccessToken string `json:"access_token"`
|
||||||
}
|
}
|
||||||
|
|
||||||
type Options struct {
|
type Options struct {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue