Create a dynamic login/logout button that calls `@inrupt/solid-client-authn-browser` to login and provie authenticated fetch. Once logged in, the authenticated fetch is automatically available to all sol-* components. Events provide hooks for other components and scripts to manually manage login/logout.
dist/vendor/:
<script src="../dist/vendor/@inrupt-solid-client-authn-browser.umd.js"></script>
<sol-login></sol-login>
The issuers attribute provides quick-select buttons in the login dropdown.
<sol-login issuers="https://solidcommunity.net, https://login.inrupt.com"></sol-login>
Listen for sol-login/sol-logout events to trigger app-specific actions.
<sol-login id="auth"></sol-login>
<script>
document.getElementById('auth').addEventListener('sol-login', (e) => {
console.log('Logged in as', e.detail.webId);
console.log('Issuer:', e.detail.issuer);
});
document.getElementById('auth').addEventListener('sol-logout', () => {
console.log('Logged out');
});
</script>