Skip to content
Snippets Groups Projects
Commit f6cd2574 authored by Neuber, Eugen Ramon's avatar Neuber, Eugen Ramon :speech_balloon:
Browse files

Update auth/README.md for external pages

Setting auth/token in <dbp-components> directly without <dbp-provider>
parent 883b15c4
No related branches found
No related tags found
No related merge requests found
Pipeline #17717 passed
......@@ -72,6 +72,29 @@ The component emits a `dbp-set-property` event for the attribute `auth`:
The component emits a `dbp-set-property` event for the attribute `requested-login-status` (possible values `logged-in`, `logged-out`).
## Alternative to &lt;dbp-auth&gt;
If embedded in an external page (without `<dbp-provider>`) components can work also together with a different source for the auth token:
```html
<dbp-person-select id="ps-1"></dbp-person-select>
<script>
function onAuthHasChanged(auth) {
/* fully featured auth object */
const ps = document.getElementById('ps-1');
ps.setProperty('auth', auth);
}
/* or */
function onTokenHasChanged(token) {
/* only token available */
const auth = { token: token };
onAuthHasChanged(auth);
}
</script>
```
PS: some components need information about the logged in person too!
## Local development
```bash
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment