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

Feature: Allow for setting the auth token on a per request basis #277

Open
2 tasks done
LVitus opened this issue Jun 7, 2024 · 1 comment
Open
2 tasks done

Feature: Allow for setting the auth token on a per request basis #277

LVitus opened this issue Jun 7, 2024 · 1 comment

Comments

@LVitus
Copy link

LVitus commented Jun 7, 2024

Is your feature request related to a problem?

I want to use scope users from the backend but creating a new connection instance for every user in the backend uses a lot of resources.

Describe the solution

It would be nice if I was able to pass the token with every request.

db.query('SELECT * FROM user',{}, token)

db.select('user', token)

This way it's possible to use scope users from the backend with the SDK. Right not it is not because all users share the same instance which uses the token which was set last.

Alternative methods

Making requests to the API myself

SurrealDB version

1.5.0 for linux on x86_64

SurrealDB.js version

1.0.0-beta.8

Contact Details

No response

Is there an existing issue for this?

  • I have searched the existing issues

Code of Conduct

  • I agree to follow this project's Code of Conduct
@mivinci
Copy link

mivinci commented Jun 24, 2024

So true!

It'll be so nice and helpful for building a multi-tenant SaaS platform using SurrealDB, because it'll make backends stateless!!

And now that a token is already optionally used when communicating with SurrealDB via HTTP, why not make it work in all SDKs also?

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

2 participants