Skip to content

Commit

Permalink
fix: add linking methods
Browse files Browse the repository at this point in the history
  • Loading branch information
joel@joellee.org committed Dec 30, 2023
1 parent 6db7cc2 commit 987adf2
Showing 1 changed file with 19 additions and 0 deletions.
19 changes: 19 additions & 0 deletions gotrue/_async/gotrue_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,25 @@ 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):
redirect_to = options.get("redirect_to")
scopes = options.get("scopes")
params = options.get("query_params", {})
if redirect_to:
params["redirect_to"] = redirect_to
if scopes:
params["scopes"] = scopes
params["skip_browser_redirect"] = True

url = await self._get_url_for_provider(provider, params)
return OAuthResponse(provider=provider, url=url)

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

async def sign_in_with_otp(
self,
credentials: SignInWithPasswordlessCredentials,
Expand Down

0 comments on commit 987adf2

Please sign in to comment.