<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@firebase/auth](./auth.md) &gt; [GithubAuthProvider](./auth.githubauthprovider.md) &gt; [credentialFromError](./auth.githubauthprovider.credentialfromerror.md)

## GithubAuthProvider.credentialFromError() method

Used to extract the underlying [OAuthCredential](./auth.oauthcredential.md) from a [AuthError](./auth.autherror.md) which was thrown during a sign-in, link, or reauthenticate operation.

<b>Signature:</b>

```typescript
static credentialFromError(error: FirebaseError): OAuthCredential | null;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  error | FirebaseError |  |

<b>Returns:</b>

[OAuthCredential](./auth.oauthcredential.md) \| null

