最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

flutter firebase reset password without dynamic links - Stack Overflow

programmeradmin0浏览0评论

In my app I use this code to send reset email link to user email:

Future<BaseResponse<bool, BaseError>> sendResetPasswordLink(
  String email,
) async {
  try {
    // await _auth.sendPasswordResetLink(email);

    var acs = ActionCodeSettings(
      // URL you want to redirect back to.
      // URL must be whitelisted in the Firebase Console.
      url: 'example',
      // dynamicLinkDomain: 'example',
      // Must be true for app handling
      handleCodeInApp: true,
      androidMinimumVersion: '1',
      androidPackageName: 'com.example.app',
      iOSBundleId: 'com.example.app',
    );

    await FirebaseAuth.instance
        .sendPasswordResetEmail(email: email, actionCodeSettings: acs);

    return BaseResponsepleted(
      true,
    );
  } catch (e) {
    return BaseResponse.error(BaseError(message: 'unknown error'));
  }
}

I don't want to use firebase dynamic links for redirecting to my app. Is there any way to do this redirection without FDL?

In my app I use this code to send reset email link to user email:

Future<BaseResponse<bool, BaseError>> sendResetPasswordLink(
  String email,
) async {
  try {
    // await _auth.sendPasswordResetLink(email);

    var acs = ActionCodeSettings(
      // URL you want to redirect back to.
      // URL must be whitelisted in the Firebase Console.
      url: 'example',
      // dynamicLinkDomain: 'example',
      // Must be true for app handling
      handleCodeInApp: true,
      androidMinimumVersion: '1',
      androidPackageName: 'com.example.app',
      iOSBundleId: 'com.example.app',
    );

    await FirebaseAuth.instance
        .sendPasswordResetEmail(email: email, actionCodeSettings: acs);

    return BaseResponsepleted(
      true,
    );
  } catch (e) {
    return BaseResponse.error(BaseError(message: 'unknown error'));
  }
}

I don't want to use firebase dynamic links for redirecting to my app. Is there any way to do this redirection without FDL?

Share Improve this question edited Feb 2 at 15:15 Frank van Puffelen 600k85 gold badges889 silver badges859 bronze badges Recognized by Google Cloud Collective asked Feb 2 at 15:07 amirhossein ghabeliamirhossein ghabeli 377 bronze badges
Add a comment  | 

1 Answer 1

Reset to default 0

Dynamic links are not required for password reset to function. You can just send the email without a continue URL, let the user click the link, reset the password in the web page, and stay there.

Alternatively you can pass a continue URL, but that doesn't have to point to Firebase Dynamic Links. You can pass any URL you like, including one that you handle yourself without Firebase Dynamic Links.

发布评论

评论列表(0)

  1. 暂无评论