Comments (6)
When I say, "currently", it is literal 😅. Here you have a preview
def set_auth(self, access_token: str) -> Session:
"""Overrides the JWT on the current client. The JWT will then be sent in
all subsequent network requests.
Parameters
----------
access_token : str
A JWT token
Returns
-------
response : Session
A logged-in session
Raises
------
error : ApiError
If an error occurs
"""
session = Session(
access_token=access_token,
token_type="bearer",
user=None,
expires_in=None,
expires_at=None,
refresh_token=None,
provider_token=None,
)
if self.current_session:
session.expires_in = self.current_session.expires_in
session.expires_at = self.current_session.expires_at
session.refresh_token = self.current_session.refresh_token
session.provider_token = self.current_session.provider_token
self._save_session(session)
return session
from supabase-py.
I'm currently working on a PR to add dataclasses to the responses and synchronize the functionalities between gotrue-py and gotrue-js, that functionality that you mention is already in gotrue-js so I will add it to gotrue-py in the PR.
from supabase-py.
If I'm not mistaken (because I'm familiar with gotrue
, but not much with the other libraries) they don't do the same.
By the way, what you want to make in the 1st option is currently possible. Although I do not know if a new release has been published with that change.
supabase_client = create_client(url, anon_key)
supabase_client.auth.set_auth(user_jwt_key)
from supabase-py.
Hey, not sure if I'm doing anything wrong. But the following does not seem to work.
session = supabase.auth.sign_in(email=os.environ.get("EMAIL"), password=os.environ.get("PASS"))
supabase.auth.set_auth(access_token=session.access_token)
data = supabase.table("videos").select("*").execute()
print(len(data.data))
This prints 0 normally but if I create the supabase client with the secret key, it prints the total number of rows. The table has RLS enabled.
from supabase-py.
from supabase import create_client, Client
The Client has no functions called set_auth.
Is that right?
from supabase-py.
Ok thank you!
Is it correct that the effect is the same in two snippets below??
supabase_client = create_client(url, anon_key)
supabase_client.set_auth(user_jwt_key)
supabase_client = create_client(url, user_jwt_key)
from supabase-py.
Related Issues (20)
- "create_client" is not exported from module "supabase"
- Readme out of date HOT 1
- Creating typed Client from supabase openapi schema HOT 3
- supabase import error: Pydantic 'bases' has incorrect type HOT 2
- Access Denied when making rpc call. HOT 1
- Access Denied when making rpc call. HOT 5
- Package conflict with e2b due to websockets HOT 8
- Deprecate supabase-py in PyPI HOT 4
- Async support HOT 4
- redirectUrl always default to localhost:3000 on sent email after using email sign up HOT 1
- Support realtime subscription HOT 7
- Support set_auth(token) and or customisation of headers for storage HOT 2
- Need to access private schemas through Client HOT 2
- SSL socket created but not properly closed. HOT 13
- self.auth.get_session() should be await HOT 5
- getting 'cannot execute INSERT in a read-only transaction' for a SELECT statement HOT 4
- Please allow httpx >= 0.25.0 HOT 3
- cannot authenticate user HOT 34
- `await supabase.auth.sign_up` raises `object NoneType can't be used in 'await' expression` HOT 2
- How to setup magic link login or is verify_otp working? If yes, how? HOT 13
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from supabase-py.