Problems with email confirmations / password resets

Hello,

I have a problem when a user is sent an email to either confirm their account by email, or to reset their password by link.

Once they have clicked the link in the email, they are taken to a page where they are either informed that they have successfully created an account, or they are given the option to change their email.

After this stage, I would like to redirect them back to the login page for the main application.

The problem I have is that I have built all of my pages in the default container, and the pages that the email directs the user to are in the system container and I am having trouble with sending the user to the login page in the default container.

I have created a button on the page in the system container with the following logic:

image

But instead of taking the user to the userLoginPage it goes to the index.html page and the url in the browser is:

subdomain.backendless.app/api/files/ui-builder/containers/default/index.html?0=p&1=a&10=o&11=g&12=i&13=n&14=P&15=a&16=g&17=e&2=g&3=e&4=%3D&5=u&6=s&7=e&8=r&9=L

So, my questions are:

  1. Is there any way to change the destination page of the {confirmation_url} in the email template while retaining the functionality to confirm email / provide password reset options?

  2. If not, what mistake am I making with the URL parameters in the redirect above?

  3. Am I better off just building the whole application in the system container to avoid this problem?

And a separate question, is there any plan to have folders in the containers so the pages can be structured and found more easily?

Thank you

Hello @Luc_Zentar

Try to use “Open Web Page” without “URL Parameters” and in input “URL” put full url
…/default/index.html?page=userLoginPage

Regards,
Viktor

@viktor.liablin that has worked, thank you!

@viktor.liablin I have done some further testing, and it works when I select that exact page for preview from the UI builder.

But if I actually follow the link from the email to that page, and then select the button that it designed to take me to the login page, it does not work and I get this error:

{“code”:6007,“message”:“The specified resource was not found”,“errorData”:{}}

Hello @Luc_Zentar

You should use an absolute URL, because if you are on the following URL https://foo.com/my/directory/path and try to open this page ../new-app the browser actually will open the next URL https://foo.com/my/new-app, so it depends where the block is used

@vladimir-upirov this still seems to cause the same issue. I’ve tested with an external URL (www.google.com) and the same thing happens with the same error message as above

Can you show what you tried and what error message you got?

I have two containers in my application. I have built my application in the default container. When the user confirms email address or resets password, they are taken to a page that is in the system container.

image

When the user has confirmed email address or reset password, I want to direct them to the login page in the default container.

The pages the user is taken to in the system container (confirmation-confirmed) and (change-password) both have buttons, and I have used this logic for onclick events for the buttons:

When I preview the confirmation-confirmed page directly from UI Builder, this works and I am taken to the login page within the default container.

But if I create a test user and click the link to confirm my email address, I am taken to the confirmation-confirmed page, and when I click the button I get this error message:

And the screen is blank.

Thanks!

Hello @Luc_Zentar

Can you provide us your app ID?

Regards,
Viktor

Hi Viktor,

The app ID is: 8518B92E-A6AA-5589-FFA0-B863E4A63F00

Thanks!

@Luc_Zentar

How do you test with a test user? Can you describe steps?
I see your system container is published, but “default” is not
Maybe you have tasted in published system container?

If you tasted in published app, url to the userLoginPage page should be another

Regards,
Viktor

@viktor.liablin An email is sent to the user email address, the link is clicked to confirm which takes the user to the confirmation-confirmed page and then the button is clicked to go to the userLogin page.

It is true that the system container is published and the default is not, is this the reason that this is happening?

Hello @Luc_Zentar

What is the url of confirm link?

https://socialteam.backendless.app/api/files/ui-builder/containers/default/index.html?page=userLoginPage

Hello @Luc_Zentar ,
I am not able to reproduce the issue, here it is my steps:

  1. Go to Backndless Console → Data → Users → Rest console
  2. Execute Post with the following body:
{
  "email":"sergey@backendless.com",
  "password":"123qwe"
}

Result:

{
	"lastLogin": null,
	"userStatus": "EMAIL_CONFIRMATION_PENDING",
	"created": 1630325897926,
	"accountType": null,
	"ownerId": "036FCF9D-F8D3-4ED1-B458-623D39AD8B86",
	"socialAccount": null,
	"oAuthIdentities": null,
	"___class": "Users",
	"blUserLocale": "en",
	"updated": null,
	"email": "sergey@backendless.com",
	"objectId": "036FCF9D-F8D3-4ED1-B458-623D39AD8B86"
}

Received email with the following body:

Hello there,

Welcome to Mina. Please confirm your email address so that you can log in and start saving.

Confirm your email address here

Thanks,
Luc | Founder, Mina

The link address is: https://socialteam.backendless.app/api/eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJhcHBJZCI6Ijg1MThCOTJFLUE2QUEtNTU4OS1GRkEwLUI4NjNFNEE2M0YwMCIsImV4cCI6MTYzMTE4OTg5NywidXNlcklkIjoiMDM2RkNGOUQtRjhEMy00RUQxLUI0NTgtNjIzRDM5QUQ4Qjg2In0.q_3jwbTGYMVff6VXSNQu693mpMwiZ347pmYq0ETxQrQ/users/confirmation

The created account was confirmed.

Please provide steps to reproduce in the same way