react-native-firebase/lib/modules/auth/providers/PhoneAuthProvider.js

28 lines
545 B
JavaScript
Raw Normal View History

2017-11-17 14:22:46 +00:00
/**
* @flow
* PhoneAuthProvider representation wrapper
*/
2018-01-24 09:46:39 +00:00
import type { AuthCredential } from '../types';
2017-11-23 17:29:40 +00:00
const providerId = 'phone';
export default class PhoneAuthProvider {
constructor() {
2018-01-25 18:25:39 +00:00
throw new Error(
'`new PhoneAuthProvider()` is not supported on the native Firebase SDKs.'
);
}
2017-11-17 14:22:46 +00:00
static get PROVIDER_ID(): string {
return providerId;
}
2017-11-17 14:22:46 +00:00
static credential(verificationId: string, code: string): AuthCredential {
return {
token: verificationId,
secret: code,
providerId,
};
}
}