Skip to content

Commit d03b3fa

Browse files
committed
SigninWithEmailAndPassword API Changes to throw OPERATION_NOT_ALLOWED error for Regional Auth
1 parent efb6ac3 commit d03b3fa

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

packages/auth/src/core/strategies/email_and_password.ts

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,12 @@ import { EmailAuthProvider } from '../providers/email';
3131
import { UserCredentialImpl } from '../user/user_credential_impl';
3232
import {
3333
_assert,
34+
_errorWithCustomMessage,
3435
_serverAppCurrentUserOperationNotSupportedError
3536
} from '../util/assert';
3637
import { _setActionCodeSettingsOnRequest } from './action_code_settings';
3738
import { signInWithCredential } from './credential';
38-
import { _castAuth } from '../auth/auth_impl';
39+
import { _castAuth, DefaultConfig } from '../auth/auth_impl';
3940
import { AuthErrorCode } from '../errors';
4041
import { getModularInstance } from '@firebase/util';
4142
import { OperationType } from '../../model/enums';
@@ -352,6 +353,15 @@ export function signInWithEmailAndPassword(
352353
_serverAppCurrentUserOperationNotSupportedError(auth)
353354
);
354355
}
356+
357+
if (auth.config.apiHost !== DefaultConfig.API_HOST) {
358+
return Promise.reject(_errorWithCustomMessage(
359+
auth,
360+
AuthErrorCode.OPERATION_NOT_ALLOWED,
361+
"The method is not implemented in Regionalized Auth"
362+
));
363+
}
364+
355365
return signInWithCredential(
356366
getModularInstance(auth),
357367
EmailAuthProvider.credential(email, password)

0 commit comments

Comments
 (0)