Back

Hashtag in base URL in account confirmation mail does not create valid URL

  • 0
  • Users
  • Flutter
  • Accounts
THE-E
30 Oct, 2023, 14:57

Hi there,

I am trying to create a mail confirmation mail with an SPA URL. The URL used as base URL contains a Hashtag: https://app.example.com/#/mailconfirmation The confirmation mail is triggered from a flutter frontend.

The problem occurs, when the mail with the link with the userID and secret has the following link structure:

TypeScript
https://app.example.com/?userId=123&secret=abc123#/mailconfirmation

The expected link structure is:

TypeScript
https://app.example.com/#/mailconfirmation?userId=123&secret=abc123

Is there something I am missing for SPA links?

My app is capable to process the expected link structure as expected, but the generated faulty link structure is obviously not usable.

The trigger function in Flutter is used in the following form:

TypeScript
  void createVerification() async {
    String baseUrl = 'https://app.example.com/#/mailconfirmation';
    var result = await _account.createVerification(
      url: baseUrl,
    );
  }
TL;DR
Title: Hashtag in base URL in account confirmation mail does not create valid URL - User trying to create a mail confirmation mail with an SPA URL - The URL used as the base URL contains a hashtag - The generated link structure in the email is incorrect - User asks if they are missing something for SPA links - Flutter code snippet provided Solution: - Use the URL path strategy instead of the hashtag strategy - Upgrading to the latest version of the appwrite package may also resolve the issue
THE-E
30 Oct, 2023, 16:17

I have checked the behaviour for the reset password template as well and it has the identical behaviour. So I guess this is the same logic for creating the link.

THE-E
30 Oct, 2023, 17:01

I used appwrite v1.4.6 and Flutter package appwrite 11.0.0.

THE-E
30 Oct, 2023, 17:16

Just upgraded to latest version. Also present in appwrite v1.4.8

Haimantika
30 Oct, 2023, 17:27

@dlohani / @Steven can you take a look here?

Drake
30 Oct, 2023, 17:35

any chance you can change the url strategy to not use the hash url strategy?

FYI, related issue: https://github.com/appwrite/appwrite/issues/2403

THE-E
30 Oct, 2023, 19:31

I was trying an URL path strategy previously, but ran into issues with my server. I might give it another try with the path strategy. But I am glad the issue is already known.

THE-E
30 Oct, 2023, 20:20

What about an option for hash-strategy handling in the unParseURL-function? https://www.tehplayground.com/iycsODpR0bqwxpaT

THE-E
30 Oct, 2023, 20:23

Nevertheless, I will try to switch back to path strategy πŸ™‚

Drake
30 Oct, 2023, 21:38

The problem is flutter uses the hash differently. It's supposed to always go at the end

Reply

Reply to this thread by joining our Discord

Reply on Discord

Need support?

Join our Discord

Get community support by joining our Discord server.

Join Discord

Get premium support

Join Appwrite Pro and get email support from our team.

Learn more