Skip to content

Commit

Permalink
feat: link and unlink
Browse files Browse the repository at this point in the history
  • Loading branch information
joel authored and joel committed Jan 12, 2024
1 parent 851e523 commit 6103511
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 4 deletions.
6 changes: 4 additions & 2 deletions gotrue/_async/gotrue_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,9 @@ async def sign_in_with_oauth(
url = await self._get_url_for_provider(provider, params)
return OAuthResponse(provider=provider, url=url)

async def link_identity(credentials):
async def link_identity(self, credentials):
provider = credentials.get("provider")
options = credentials.get("options", {})
redirect_to = options.get("redirect_to")
scopes = options.get("scopes")
params = options.get("query_params", {})
Expand All @@ -287,7 +289,7 @@ async def link_identity(credentials):
url = await self._get_url_for_provider(provider, params)
return OAuthResponse(provider=provider, url=url)

async def unlink_identity(identity):
async def unlink_identity(self, identity):
return await self._request(
"POST",
f"/user/identities/{identity.identity_id}",
Expand Down
6 changes: 4 additions & 2 deletions gotrue/_sync/gotrue_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,9 @@ def sign_in_with_oauth(
url = self._get_url_for_provider(provider, params)
return OAuthResponse(provider=provider, url=url)

def link_identity(credentials):
def link_identity(self, credentials):
provider = credentials.get("provider")
options = credentials.get("options", {})
redirect_to = options.get("redirect_to")
scopes = options.get("scopes")
params = options.get("query_params", {})
Expand All @@ -287,7 +289,7 @@ def link_identity(credentials):
url = self._get_url_for_provider(provider, params)
return OAuthResponse(provider=provider, url=url)

def unlink_identity(identity):
def unlink_identity(self, identity):
return self._request(
"POST",
f"/user/identities/{identity.identity_id}",
Expand Down

0 comments on commit 6103511

Please sign in to comment.