Basic frontend-only auth
This is not actually secure, but good enough to protect non-public resources. Wrap your content in an
auth-form element. Even if it's a web component, as long as the
auth-form component initializes first, there shouldn't be any issues with the inner
components running first. Use btoa('admin') and btoa('password') to generate
the encoded frontend-only username and password (or comma-separated lists of usernames and passwords like
btoa('password1,password2')). Then set the attributes on the component like this:
<auth-form user="YWRtaW4sanVzdGlu" pass="cGFzc3dvcmQscGFzcw=="></auth-form>