Cant login with newly created/registered accounts on my custom login page. - Mendix Forum

Cant login with newly created/registered accounts on my custom login page.

0

Hi everyone,

I’m new to Mendix and trying out the learning path ‘Create an App with Advanced Page Building’. 

However, I’m stuck at the 3rd module since I don’t get the login function to work. I can’t login with any of my previously created accounts, and accounts I registered from the ‘sign up here’ page I build are also unable to login. I get the validation error that my username or password are incorrect. Also, the accounts I register (as an anonymous user) don’t show up as a new team member.

Microflow to create a new Team member (available once logged in):

Microflow to create new team member by filling in the registration page accessed from the login page. 

Created object:

Edit: It seems like the registration won’t commit; I get the error that multiple User Roles are selected.  However, in the microflow above I included the XPath constrain [Name = 'Requestor'] in the retrieve activity. This doesn’t seem to work. 

Microflow for checking whether only 1 role is selected.

So two issues:

  1. Unable to login with created accounts
  2. Unable to commit a new registration (probably due to the error produced by the above microflow). 
     

Thanks! 

asked
1 answers
2

I have noticed that you are creating and committing the “NewTeamMember” object in the first microflow which is incorrect for two reasons:

  1. You don’t know if the user will proceed with filling valid details and saving the account after showing the page, which leaves you with empty objects in that case.
  2. Mendix won’t allow you to commit a new User object or any object of an entity that is a specialization of User without the “Password” attribute being filled. And you are not filling the “Password” attribute in the first microflow.

 

It is also not recommended to retrieve UserRole objects from the database using the “Name” attribute because it can change, and that won’t dynamically change in your microflows. Instead, you can use the “id” when writing your XPATH (e.g. [id='[%UserRole_Requestor%]']).

Let me know if that helps you close down on the bugs you’re facing.

answered