Skip to content

Commit 35de56a

Browse files
committed
fix: improve error message for account connection with different provider
1 parent 5069622 commit 35de56a

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/providers/AuthProvider.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,13 +87,13 @@ export const AuthProvider = ({ children }: { children: React.ReactNode }) => {
8787
useEffect(() => {
8888
const token = searchParams.get('access_token')
8989
const provider = searchParams.get('provider')
90+
const oppositeProvider = provider === 'google' ? 'Github' : 'Google'
9091
connectTheUser(token, provider).catch((error) => {
9192
openAuthModal()
9293
console.log('error', error)
9394
if (error && error.code === 'auth/account-exists-with-different-credential') {
9495
setAuthError({
95-
message:
96-
'This account is already connected with a different provider. Please sign in with that provider to continue.',
96+
message: `You've previously signed up using ${oppositeProvider}. To continue, please sign in with ${oppositeProvider}.`,
9797
})
9898
} else {
9999
setAuthError({

0 commit comments

Comments
 (0)