How to implement login from marketplace and change it

0
Hello,   This is the first time for me working with Mendix and for our school assignment we have to create an app where you can book rooms. I have finished most of the assignment but now i have to implement a login page. Our teacher told us we can use the login page from the Mendix marketplace.   I want to use this login page but change it a bit. When an user registers to the system i also want him to enter his firstname, lastname etc. from my domain model. In my domain model i have a person entity with these attributes.  The host and user have a generalization of this entity because they have different roles.   My question to you is, how do i implement the login page from the marketplace, since i never used somthing from the marketplace, and how can i add the option to enter the credentials from the person entity? I prefer an explanation that is a step-by step since i am new to Mendix and i would like to understand everything that i am doing.   Thanks in advance!
asked
1 answers
0

Hi Tim,

 

The first link you shared is not a login page from the Marketplace. It is a New Account page that is provided by default with every new project. This will not work for login purposes and should also not be attempted to be used in such a way. From a security perspective you do not want to give an anonymous user access to the Account entity. That is a security breach waiting to happen.

 

With that out of the way: why would you want the user to also provide first name, last name, etc when logging in? What you can do instead is associating your Person entity with the Account entity (cross module association has to be set from the entity properties rather than drawing an association line). On creation of the account you can select the person the account is for and thus setting the association. When a user logs into your app you can retrieve the associated Person entity (you will want to use a dataview with a microflow as datasource), giving you access to all its information. Keep in mind that the Account entity also has information like first name, last name, email address, etc. So think if you want to use and show the Person entity or the Account entity (and consequently also if you need a Person entity at all).

 

Additionally, there is no need to use the login widget from the marketplace anymore. You can create a new page and select the login template. That will give you a page with everything you will need. You can also edit this page if you want to. 

 

Hope this helps!

All the best and good luck,

 

Yves

answered