Skip to content

Commit bf66f88

Browse files
committed
revert: remove instant auth api bypass due to lack of service role key
1 parent 143b45d commit bf66f88

2 files changed

Lines changed: 1 addition & 72 deletions

File tree

app/api/auth/instant/route.ts

Lines changed: 0 additions & 49 deletions
This file was deleted.

lib/features/auth/auth-service.ts

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -219,29 +219,7 @@ export async function signInOrSignUpWithEmailOnly(
219219
return signInResult; // Successfully logged in
220220
}
221221

222-
// 2. If sign in fails due to "Invalid login credentials", the user might exist but with a different password.
223-
// We call our secure backend bypass to sync their password to the hidden instant auth password.
224-
if (signInResult.error && signInResult.error.toLowerCase().includes("invalid login credentials")) {
225-
try {
226-
const syncRes = await fetch('/api/auth/instant', {
227-
method: 'POST',
228-
headers: { 'Content-Type': 'application/json' },
229-
body: JSON.stringify({ email, password: hiddenPassword })
230-
});
231-
232-
if (syncRes.ok) {
233-
const syncData = await syncRes.json();
234-
if (syncData.success) {
235-
// Password successfully synced! Retry sign in.
236-
return await signIn(email, hiddenPassword, rememberMe);
237-
}
238-
}
239-
} catch (err) {
240-
console.error("Failed to sync instant auth password:", err);
241-
}
242-
}
243-
244-
// 3. If sign in fails and sync didn't resolve it (likely because user doesn't exist), attempt to sign up
222+
// 2. If sign in fails (likely because user doesn't exist), attempt to sign up
245223
const signUpResult = await signUp(email, hiddenPassword);
246224

247225
if (signUpResult.success) {

0 commit comments

Comments
 (0)