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

support linkIdentity #503

Closed
2 tasks done
johndpope opened this issue Mar 6, 2024 · 1 comment
Closed
2 tasks done

support linkIdentity #503

johndpope opened this issue Mar 6, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@johndpope
Copy link

johndpope commented Mar 6, 2024

General Info

  • I installed the latest version of Supabase Kt
  • I checked for similar feature requests

Feature request

supabase/auth#313
we need similar capabilities in mobile

// assume user is already logged in and authenticated

// link the current user to a google identity
// this works very similar to signInWithOAuth() and will redirect the user to google to complete the oauth flow 
// once the oauth flow has been completed, the user will be redirected back to the app with the identity linked
const { data, error } = await supabase.auth.linkIdentity({ provider: 'google' })

// fetch all identities linked to the current user
const { data: { identities } } = await supabase.auth.getUserIdentities()

const googleIdentity = identities.find(identity => identity.provider === 'google')

// unlink an identity
await supabase.auth.unlinkIdentity(googleIdentity)

Usecase

supabase/supabase-swift#256

@johndpope johndpope added the enhancement New feature or request label Mar 6, 2024
@jan-tennert
Copy link
Collaborator

Hey, @johndpope gotrue-kt already supports linking identities see docs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants