Add app password support to Photoprism
This commit is contained in:
parent
865ca73ebc
commit
f57b2741ea
@ -14,3 +14,12 @@ widget:
|
||||
username: admin
|
||||
password: password
|
||||
```
|
||||
|
||||
If using app passwords, you can create one and specify that for authorization.
|
||||
|
||||
```yaml
|
||||
widget:
|
||||
type: photoprism
|
||||
url: http://photoprism.host.or.ip:port
|
||||
authToken: <app password from Photoprism>
|
||||
```
|
||||
|
||||
@ -32,6 +32,12 @@ export default async function photoprismProxyHandler(req, res) {
|
||||
username: widget.username,
|
||||
password: widget.password,
|
||||
});
|
||||
} else if (widget.authToken) {
|
||||
params.headers = { "Content-Type": "application/json", Authorization: `Bearer ${widget.authToken}` };
|
||||
|
||||
params.body = JSON.stringify({
|
||||
authToken: widget.authToken,
|
||||
});
|
||||
}
|
||||
|
||||
const [status, contentType, data] = await httpProxy(url, params);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user