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