指南
Firebase 身份验证教程
使用@capgo/capacitor-firebase-authentication
Capacitor插件用于Firebase 身份验证
安装
bun add @capgo/capacitor-firebase-authentication
bunx cap sync
此插件暴露的内容
applyActionCode- 验证通过邮件发送给用户的code。confirmPasswordReset- 完成密码重置流程。confirmVerificationCode- 完成手机验证码验证流程。createUserWithEmailAndPassword- 使用邮箱和密码创建新用户账户。如果新账户创建成功,用户会自动登录。
- 示例使用
applyActionCode
Applies a verification code sent to the user by email.
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.applyActionCode({} as ApplyActionCodeOptions);
confirmPasswordReset
- 完成密码重置流程。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.confirmPasswordReset({} as ConfirmPasswordResetOptions);
confirmVerificationCode
- 完成手机验证码验证流程。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.confirmVerificationCode({} as ConfirmVerificationCodeOptions);
createUserWithEmailAndPassword
- 使用邮箱和密码创建新用户账户。如果新账户创建成功,用户会自动登录。
import { FirebaseAuthentication } from '@capgo/capacitor-firebase-authentication';
await FirebaseAuthentication.createUserWithEmailAndPassword({} as CreateUserWithEmailAndPasswordOptions);
- 全部参考
- - GitHub: - https://github.com/Cap-go/capacitor-firebase/tree/main/packages/authentication
- - 文档:/docs/plugins/firebase-authentication/
- 从使用 @capgo/capacitor-firebase-authentication 中继续
If you are using 使用 @capgo/capacitor-firebase-authentication 为了规划身份验证和帐号流程,连接它与 @capgo/capacitor-social-login 查看 @capgo/capacitor-social-login 的实现细节 @capgo/capacitor-passkey 查看 @capgo/capacitor-passkey 的实现细节 @capgo/capacitor-native-biometric 查看 @capgo/capacitor-native-biometric 的实现细节 两因素身份验证 查看两因素身份验证的实现细节,并且 SSO (企业) 为 SSO (企业) 的实现细节。