feat: typescript support in auth components

Co-authored-by: Andrew Bastin <andrewbastin.k@gmail.com>
This commit is contained in:
liyasthomas
2021-08-29 19:31:23 +05:30
parent 39fbf4ef33
commit 91352ade20
2 changed files with 34 additions and 100 deletions

View File

@@ -13,6 +13,9 @@ import {
signInWithEmailLink as signInWithEmailLinkFB,
ActionCodeSettings,
signOut,
linkWithCredential,
AuthCredential,
UserCredential,
} from "firebase/auth"
import {
onSnapshot,
@@ -176,6 +179,13 @@ export async function getSignInMethodsForEmail(email: string) {
return await fetchSignInMethodsForEmail(getAuth(), email)
}
export async function linkWithFBCredential(
user: User,
credential: AuthCredential
) {
return await linkWithCredential(user, credential)
}
/**
* Sends an email with the signin link to the user
*
@@ -244,6 +254,10 @@ export async function setProviderInfo(id: string, token: string) {
}
}
export function getGithubCredentialFromResult(result: UserCredential) {
return GithubAuthProvider.credentialFromResult(result)
}
/**
* A Vue composable function that is called when the auth status
* is being updated to being logged in (fired multiple times),