Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Fetch] What's stopping us from using the Fetch API configuration to support this? #39

Open
wparad opened this issue Apr 9, 2024 · 0 comments

Comments

@wparad
Copy link

wparad commented Apr 9, 2024

After thinking about this a lot more, it seems like there is a real opportunity here to move the configuration into the fetch api for browsers. This is going to be api requests, and fetch will likely ultimately be used here, fetch could just take in a new parameter for session management:

await fetch('/sessions', {
  method: 'POST',
  sessionConfiguration: {
    type: 'TOTP / TPM / HOTP',
    expiry: 60000,
    metadata: {
       sessionIdentifier: 'hello'
    }
  }
});

And then for each subsequent request, fetch could inject in a header with the signature automatically if configured:

await fetch('/sessions', {
  method: 'POST',
  sessionConfiguration: {
    enabled: true
  }
});

Or whatever, seems like an easy solution here, what am I missing?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant