UNPKG

2.15 kBTypeScriptView Raw
1/**
2 * @license
3 * Copyright 2020 Google LLC
4 *
5 * Licensed under the Apache License, Version 2.0 (the "License");
6 * you may not use this file except in compliance with the License.
7 * You may obtain a copy of the License at
8 *
9 * http://www.apache.org/licenses/LICENSE-2.0
10 *
11 * Unless required by applicable law or agreed to in writing, software
12 * distributed under the License is distributed on an "AS IS" BASIS,
13 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 * See the License for the specific language governing permissions and
15 * limitations under the License.
16 */
17import { UserCredential, Auth, User } from '../../model/public_types';
18import { AuthInternal } from '../../model/auth';
19import { AuthCredential } from '../credentials';
20export declare function _signInWithCredential(auth: AuthInternal, credential: AuthCredential, bypassAuthState?: boolean): Promise<UserCredential>;
21/**
22 * Asynchronously signs in with the given credentials.
23 *
24 * @remarks
25 * An {@link AuthProvider} can be used to generate the credential.
26 *
27 * @param auth - The {@link Auth} instance.
28 * @param credential - The auth credential.
29 *
30 * @public
31 */
32export declare function signInWithCredential(auth: Auth, credential: AuthCredential): Promise<UserCredential>;
33/**
34 * Links the user account with the given credentials.
35 *
36 * @remarks
37 * An {@link AuthProvider} can be used to generate the credential.
38 *
39 * @param user - The user.
40 * @param credential - The auth credential.
41 *
42 * @public
43 */
44export declare function linkWithCredential(user: User, credential: AuthCredential): Promise<UserCredential>;
45/**
46 * Re-authenticates a user using a fresh credential.
47 *
48 * @remarks
49 * Use before operations such as {@link updatePassword} that require tokens from recent sign-in
50 * attempts. This method can be used to recover from a `CREDENTIAL_TOO_OLD_LOGIN_AGAIN` error.
51 *
52 * @param user - The user.
53 * @param credential - The auth credential.
54 *
55 * @public
56 */
57export declare function reauthenticateWithCredential(user: User, credential: AuthCredential): Promise<UserCredential>;