2036
Views
5
Comments
Solved
User Login

The objective for this logic is to be able to the users to login using username or email address, which is being stored in users database.

sample db structure.

username           email address                          reason

testuser1             test@email.com    (they are a couple that would share the same email)

testuser2            test@email.com

1.lets say a user login with test@email.com

2. get the current list in users table with has username of test@email.com

the result would contain 2 records.

3.then i would try to login the first record testuser1

if login <> true then 

loop to the next record


problem: if i use the login functionality of users espace, during my initial login which is false

it would go to the exception page, what i wanted is, if the first login fails, it would loop as to how many records contains on the list using the test@email until it hit the correct password.

this feature or logic merely giving the users a flexibility to login both username and email.


Sample Implementation:


Thanks,

JunJun


mvp_badge
MVP
Rank: #6
Solution

Hello Juius,

You can do this:

Move the Login to a server action, and in case of exception, set the output parameter to False.
Use your Server Action in the place of the User_Login in your Screen Action.

Now, instead of an exception in your Screen Action, you will receive a True/False value from your personal login function that tells if the login was successfull or not.

Cheers.

Rank: #238

Hi Jun,


To allow the user to login with username or e-mail, both need to be exclusive / unique per user.


Otherwise you can never be sure of what is the user / person that is being authenticated.


In an extreme example: if both use the same password and login with the e-mail, which user would you load?


Cheers,

Renato


Jun Jun wrote:

The objective for this logic is to be able to the users to login using username or email address, which is being stored in users database.

sample db structure.

username           email address                          reason

testuser1             test@email.com    (they are a couple that would share the same email)

testuser2            test@email.com

1.lets say a user login with test@email.com

2. get the current list in users table with has username of test@email.com

the result would contain 2 records.

3.then i would try to login the first record testuser1

if login <> true then 

loop to the next record


problem: if i use the login functionality of users espace, during my initial login which is false

it would go to the exception page, what i wanted is, if the first login fails, it would loop as to how many records contains on the list using the test@email until it hit the correct password.

this feature or logic merely giving the users a flexibility to login both username and email.


Sample Implementation:


Thanks,

JunJun




mvp_badge
MVP
Rank: #6
Solution

Hello Juius,

You can do this:

Move the Login to a server action, and in case of exception, set the output parameter to False.
Use your Server Action in the place of the User_Login in your Screen Action.

Now, instead of an exception in your Screen Action, you will receive a True/False value from your personal login function that tells if the login was successfull or not.

Cheers.