Retrieve email confirmation token without sending email

Hey @grace.hong ,

as many others I am in the situation I would need to send a customized email, through Postmark, both for the confirmation of the email address an for an eventual password reset.

My setup is that the user, after having input their email address and chosen a password, should receive the confirmation email.
At that point the signup process is “freezed” up to when the user confirms their email by clicking on the link in the email.
Once clicked, the signup flow continues by asking further information to the user and recording them.

In order to do that, I trigger a custom event that contains a “sign the user up” action (and runs only when the "Current User email confirmed is ‘no’ ").
After that, I call a backend API (always just when the “Current User email confirmed is ‘no’”) whose flow includes the “send a confirmation email” with the “just token” checkbox checked that I use in the following step to create the link I send to the user by email.

Another custom event with the successive actions is triggered by a "When Current User email confirmed is ‘yes’ " event.
Now, everything seems to work smoothly except that, when the user clicks on the email link, they are brought to a new browser tab where the user is asked to log in.
In the original browser tab, the one where the user started their signup process, instead, the custom event constrained by the “Current User email confirmed is ‘yes’” boolean, is triggered, meaning that the email is correctly verified.

So it looks to me that in the original tab the user session is kept active, while in the new tab it isn’t.

Can you confirm I am doing the right steps?

Is there anything maybe I am missing in order to let the users go on with their signup process in the newly opened browser tab after they click on the email link?

Furthermore, is the generated token valid forever? In such a case is there a way to make it invalid after a specific amount of time so that the user must ask for it again when they want to confirm their email address?

Lastly, I tried to add a “log the user out” to the backend API flow after sending the email with the link, to check if the issue was related to the fact the user was logged in in the original tab.
Curiously, in the original tab, the user stays logged in and once the email link is clicked, the flow proceeds with the next actions triggered when the “Current User email confirmed is ‘yes’”.

Thank you!