# NextAuth / Auth.js: OAuthAccountNotLinked — To confirm your identity, sign in with the same account you used originally

**Code:** `OAuthAccountNotLinked` · **Category:** Authentication · **Seen on:** REST API

A user tried to sign in with a new OAuth provider using an email that already belongs to an account created with a different provider.

## Meaning

For security, Auth.js won’t automatically link accounts by email (could allow account takeover). Users must sign in with the original provider, or you enable linking only for providers that verify emails.

## Common causes

- Same email registered via another provider (Google vs GitHub vs email)
- Account created via credentials/email link earlier

## Quick fix

1. Ask users to sign in with the original provider, then link accounts
2. Set allowDangerousEmailAccountLinking only for trusted, email-verifying providers
3. Show a clear message on the error page

## Detailed fix by platform

### JavaScript

1. `GoogleProvider({ clientId, clientSecret, allowDangerousEmailAccountLinking: true })   // only if you accept the trade-off`

## How to diagnose

1. **Accounts** — Existing provider for that email
2. **Policy** — Linking allowed?

---
Source: [WhatIsMyError](https://whatismyerror.com/errors/auth/nextauth-oauthaccountnotlinked)
