Skip to content
This repository was archived by the owner on Sep 8, 2025. It is now read-only.
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion supabase_auth/_async/gotrue_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
SignOutOptions,
SignUpWithPasswordCredentials,
Subscription,
UpdateUserOptions,
UserAttributes,
UserIdentity,
UserResponse,
Expand Down Expand Up @@ -647,7 +648,9 @@ async def get_user(self, jwt: Optional[str] = None) -> Optional[UserResponse]:
return None
return await self._request("GET", "user", jwt=jwt, xform=parse_user_response)

async def update_user(self, attributes: UserAttributes) -> UserResponse:
async def update_user(
self, attributes: UserAttributes, options: UpdateUserOptions = {}
) -> UserResponse:
"""
Updates user data, if there is a logged in user.
"""
Expand All @@ -658,6 +661,7 @@ async def update_user(self, attributes: UserAttributes) -> UserResponse:
"PUT",
"user",
body=attributes,
redirect_to=options.get("email_redirect_to"),
jwt=session.access_token,
xform=parse_user_response,
)
Expand Down
6 changes: 5 additions & 1 deletion supabase_auth/_sync/gotrue_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,7 @@
SignOutOptions,
SignUpWithPasswordCredentials,
Subscription,
UpdateUserOptions,
UserAttributes,
UserIdentity,
UserResponse,
Expand Down Expand Up @@ -645,7 +646,9 @@ def get_user(self, jwt: Optional[str] = None) -> Optional[UserResponse]:
return None
return self._request("GET", "user", jwt=jwt, xform=parse_user_response)

def update_user(self, attributes: UserAttributes) -> UserResponse:
def update_user(
self, attributes: UserAttributes, options: UpdateUserOptions = {}
) -> UserResponse:
"""
Updates user data, if there is a logged in user.
"""
Expand All @@ -656,6 +659,7 @@ def update_user(self, attributes: UserAttributes) -> UserResponse:
"PUT",
"user",
body=attributes,
redirect_to=options.get("email_redirect_to"),
jwt=session.access_token,
xform=parse_user_response,
)
Expand Down
4 changes: 4 additions & 0 deletions supabase_auth/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,10 @@ class Options(TypedDict):
captcha_token: NotRequired[str]


class UpdateUserOptions(TypedDict):
email_redirect_to: NotRequired[str]


class InviteUserByEmailOptions(TypedDict):
redirect_to: NotRequired[str]
data: NotRequired[Any]
Expand Down