Foren

How to handle email verification after a new user created?

Zhenlei Li, geändert vor 8 Jahren.

How to handle email verification after a new user created?

Junior Member Beiträge: 51 Beitrittsdatum: 13.07.14 Neueste Beiträge
I am working on v6.2CE.
created a customized self-registration portlet, inside this portlet:
UserServiceUtil.addUserWithWorkflow(......) API to create a new user with fixed password, and then
UserLocalServiceUtil.sendEmailAddressVerification(newUser, newUser.getEmailAddress(), serviceContext);

I am hoping - the new user shouldn't be actived immediately, the new user has to follow the verification email to response to liferay portal by entering the verification-code, after that the portal active the account automatically.

But the actual result is NOT! the new user can enter the liferay portal immediately with correct email/password.

Can anybody explain to me - what's the proper way let the verification email active the new account rather than the new account woking at once?

Thank you
thumbnail
David H Nebinger, geändert vor 8 Jahren.

RE: How to handle email verification after a new user created?

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
I guess you could hook the login portlet to see if they've completed verification before letting them in... A pre login action could throw an exception, but that won't give you a visual cue as to what is necessary.
thumbnail
Samuel Kong, geändert vor 8 Jahren.

RE: How to handle email verification after a new user created?

Liferay Legend Beiträge: 1902 Beitrittsdatum: 10.03.08 Neueste Beiträge
In Control Panel > Configuration > Portal Settings > Authentication,
is "Require strangers to verify their email address" checked?
Zhenlei Li, geändert vor 8 Jahren.

RE: How to handle email verification after a new user created?

Junior Member Beiträge: 51 Beitrittsdatum: 13.07.14 Neueste Beiträge
Samuel Kong:
In Control Panel > Configuration > Portal Settings > Authentication,
is "Require strangers to verify their email address" checked?


Hi Samuel, thank you for the reply.

I am using Liferay Portal Community Edition 6.2 CE GA2 ,
could not find the configuraton to turn on/off "Require strangers to verify their email address".
There is a setting about - Require all users to verify their email address, got really worse experience after I ticked it!
The portal required evereybody to verify email address, otherwise, no way to enter portal.
thumbnail
Samuel Kong, geändert vor 8 Jahren.

RE: How to handle email verification after a new user created?

Liferay Legend Beiträge: 1902 Beitrittsdatum: 10.03.08 Neueste Beiträge
Zhenlei Li:
There is a setting about - Require all users to verify their email address, got really worse experience after I ticked it!
The portal required evereybody to verify email address, otherwise, no way to enter portal.


After you check "Require all users to verify their email address", the portal will not allow users to sign in unless the "emailAddressVerified" field for the user is set to true. If you want to require some users to verify their email address but not others, than you'll need to update the user's "emailAddressVerified" property to true when their account is created.
Zhenlei Li, geändert vor 8 Jahren.

RE: How to handle email verification after a new user created?

Junior Member Beiträge: 51 Beitrittsdatum: 13.07.14 Neueste Beiträge
David H Nebinger:
I guess you could hook the login portlet to see if they've completed verification before letting them in... A pre login action could throw an exception, but that won't give you a visual cue as to what is necessary.


A good solution David!
BTW, how to know the new user reply liferay with proper verification-code already? I didn't find this kind of API so far.
If we can detect that new user send back the correct verification-code, then we can define a scheduled job to active the user.

Thank you
thumbnail
David H Nebinger, geändert vor 8 Jahren.

RE: How to handle email verification after a new user created?

Liferay Legend Beiträge: 14919 Beitrittsdatum: 02.09.06 Neueste Beiträge
It should be based upon the User status member value. This is a workflow value so you should be able to check for the right (or wrong) value(s) and make appropriate decisions.
Zhenlei Li, geändert vor 8 Jahren.

RE: How to handle email verification after a new user created?

Junior Member Beiträge: 51 Beitrittsdatum: 13.07.14 Neueste Beiträge
David H Nebinger:
It should be based upon the User status member value. This is a workflow value so you should be able to check for the right (or wrong) value(s) and make appropriate decisions.


Will try, thank you again.