Skip to content

Accessing fetch without loggedInCallback? #1

@josephguillaume

Description

@josephguillaume

The current minimal usage example doesn't use any html attributes so it's not immediately clear how the authenticated fetch function would be accessed.

If I understand correctly, the user would need to call the getDefaultSession function somewhere in their code and would need some kind of logic to avoid a race condition or poll for changes.

This seems inadvisable and it might be better for the minimal usage example to include use of loggedInCallback instead?

Perhaps a separate issue, but the demo also requires the web component to be rendered using JavaScript, which seems like an unfortunate requirement for a web component. Perhaps the minimal usage example could demonstrate setting loggedInCallback as a property from the module script instead.

i.e. presumably something like

<script type="module">
  import 'solid-login/solid-login.js';
  document.querySelector("solid-login").loggedInCallback=({fetch,session})=>fetch("http://example.com/private/resource")
</script>

<solid-login />

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions