# Firebase Auth: auth/credential-already-in-use

> Firebase linking fails with auth/credential-already-in-use: that Google or Apple account already belongs to another user. Sign in to it and merge the data.

Canonical: https://app369.com/fix/firebase-auth-credential-already-in-use/
Last updated: 2026-11-09

auth/credential-already-in-use is the Firebase Auth error for linking a provider account that already belongs to another Firebase user. It often hits apps that start users as anonymous guests and later ask them to sign in with Google or Apple.

**Short answer**

Catch the error and take the credential from it. Save what the current user has, sign in with that credential to reach the existing account, then copy the saved data over and delete the old guest user from your server with the Admin SDK. Don’t try to link the same credential again.

Rather not fix it yourself? [**App Fix Ticket**](https://app369.com/fixed-price/flutter-firebase-bug-fix/) starts with a fixed-price diagnosis, then a fixed price for the fix before any fix work.

## **Why the link fails, and the fix**

1. 01 ### **An anonymous guest signs in with an existing account**
  > “Account linking will fail if the credentials are already linked to another user account.” [**Firebase, Link multiple auth providers**](https://firebase.google.com/docs/auth/web/account-linking) The guest is one Firebase user, and the Google account already belongs to another. Firebase won’t join two users by linking, so the app has to switch to the existing one and move the guest’s data.```
import { getAuth, linkWithPopup, signInWithCredential, GoogleAuthProvider } from 'firebase/auth';

const auth = getAuth();
const guest = auth.currentUser;
try {
  await linkWithPopup(guest, new GoogleAuthProvider());
} catch (error) {
  if (error.code === 'auth/credential-already-in-use') {
    const cred = GoogleAuthProvider.credentialFromError(error);
    const guestData = await loadData(guest.uid); // your own data layer
    const { user } = await signInWithCredential(auth, cred);
    await mergeData(user.uid, guestData);
  }
}
```
2. 02 ### **The guest data is read too late** After signInWithCredential the app is signed in as the other user, and rules may stop it reading the guest’s documents. Read and keep the guest data before you switch.
3. 03 ### **The old guest user is left behind** Each failed upgrade can leave an empty anonymous user. After the merge the app is signed in as the other user, so delete the guest from your server with the Admin SDK, or let a scheduled cleanup remove old anonymous accounts.
4. 04 ### **A signed-in user links someone else’s account** Also check: on a shared device, a user can pick another person’s Google account in the chooser. Show which account is in use and let the user choose to switch rather than merging silently.

Checked against the vendor’s docs on November 9, 2026: [Firebase docs: Link multiple auth providers](https://firebase.google.com/docs/auth/web/account-linking).

## **Rather hand it over?**

Fixed scope, fixed price, paid upfront. The work happens in writing; no call needed.

- [from $450**App Fix Ticket**One reproducible bug in an existing mobile or web app, diagnosed and fixed.**See scope and start**](https://app369.com/fixed-price/flutter-firebase-bug-fix/)
- [from $450**AI-Built App Rescue**A Lovable, Bolt or Cursor app checked end to end in 3 days, then its worst problems fixed at a fixed price.****No issues worth fixing, no charge.**** If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.**See scope and start**](https://app369.com/fixed-price/ai-app-rescue/)

[**All 127 Fiverr reviews**](https://app369.com/reviews/)

Related: [**Firebase auth/provider-already-linked**](https://app369.com/fix/firebase-auth-provider-already-linked/) · [**Firebase account-exists-with-different-credential**](https://app369.com/fix/firebase-auth-account-exists-with-different-credential/) · [**Firebase auth/email-already-in-use**](https://app369.com/fix/firebase-auth-email-already-in-use/) · [**Firebase auth/missing-or-invalid-nonce**](https://app369.com/fix/firebase-auth-missing-or-invalid-nonce/)

Questions

## **More on this error**

<details>

<summary>**How is this different from account-exists-with-different-credential? **+</summary>

account-exists-with-different-credential happens at sign-in, when the email belongs to a user with another provider. credential-already-in-use happens when linking, when the provider account itself already belongs to another user.

</details>

<details>

<summary>**Can I merge two Firebase users into one? **+</summary>

Not with linking. Copy the data you need to the account you keep, then delete the other user.

</details>

<details>

<summary>**Can you fix it for me? **+</summary>

If one bug is the whole problem, the App Fix Ticket covers it: a written diagnosis first, then the fix. If the app has more going on, the Launch Check is a written check of the whole app. Each issue found is rated critical, high, medium or low, with where it is and how it was confirmed. No issues worth fixing, no charge. If the Launch Check finds nothing rated medium or higher, Simon refunds the full $450. You keep the report either way. This applies to the first 10 Launch Checks bought after October 30, 2026.

</details>

A different error?

## **Describe it and get a written quote**

Send the error and what you were doing. You get a written scope, a fixed price and a timeline; Simon replies by email, usually within one business day.

[**Describe your problem **→](https://app369.com/contact/) [**All fixes**](https://app369.com/fix/)