How to reproduce:
on loggintoboggan setup page:
1. Set password - on
2. Non-authenticated role - create new role on roles page and choose from list
3. Immediate login - on

After module setup:
1. Try to register new user (after registration you will be logged in).
2. View validation e-mail and follow validation link
3. Read drupal_set_message (You are logged as %username%)

And no validation at all. You can also try to turn off "Immediate login" and after registration (but before validation link) log in.
The reason for this is in function user_pass_reset (user.pages.inc). In the first lines there is a check:

if ($user->uid) {
...

And for this condition, there is no validation instructions.

Maybe logintoboggan have to remove ability for logging with pre-auth role?

Comments

Anonymous’s picture

Same issue here.

validate link [current-user:validate-url] in the email gives a page not found.
Resent validate email in the user account gives a [current-user:validate-url] that works ok.

bdziewierz’s picture

Same problem. User currently logged in doesn't get validated.

bdziewierz’s picture

Actually, I recall my last message - this works correctly. Use [user:validate-url] token and not [user:one-time-login-url] in your Welcome email template.

bdziewierz’s picture

@cmseasy: Shouldn't it be [user:validate-url]?

stevecowie’s picture

Hi
If I've understood your problem correctly, this is a matter of re-configuring the welcome, no approval needed email as mentioned on the LT configuration page:
"NOTE: If you enable this feature, you should edit the Welcome (no approval required) text. More help in writing the e-mail message can be found at LoginToboggan help."

guy_schneerson’s picture

I am evaluating the use of the module for a job and may have hit the same issue
if I allow immediate login and use a Non-authenticated role, when a user gets a validation email and clicks the url it doesn't work and the user has no authenticated role.
hope this helps i haven't spent to long looking at this so may have missed something about how the module operates.

makbul_khan8’s picture

Hi

Thanks bdziewierz,
You saved my lots of time by providing such an important token replacement.
use this:
[user:validate-url]
instead of
[user:one-time-login-url]
in your Welcome email template.

danoprey’s picture

Sorry for being an idiot, but where do I put the [user:validate-url] token? I don't see a token UI and I've tried it in my welcome email, no luck.

makbul_khan8’s picture

Hi danoprey,
I am not sure but I think we get [user:validate-url] token if we have logintoboggan module installed.
we can use this token on admin/config/people/accounts/settings E-mail section tab and can also be used in custom code.

Thanks

stevecowie’s picture

makbul_khan8 is correct. The Token is created by LT, and if you install token module you can browse available tokens.

jon pugh’s picture

Title: Can't validate user account (with pre-auth role) via e-mail if user logged in » Required configuration changes to "Welcome Email" are not well documented.
Version: 7.x-1.3 » 7.x-1.x-dev
Component: Code » Documentation
Assigned: Unassigned » jon pugh
Category: bug » task
Priority: Normal » Major

This is very poorly documented. I am going to create a patch that explains this more.

jon pugh’s picture

Attached.

Dave Cohen’s picture

+1

Glad I found this thread. I was struggling to figure out why users couldn't get out of pre-authenticated state.

Dave Cohen’s picture

Issue summary: View changes

spell fix

dooug’s picture

Status: Active » Needs work

@John Pugh, thanks for the patch. Though, It looks like it has some whitespace and other nit-picks than needs clean-up to meet coding standards.

makbul_khan8’s picture

Assigned: jon pugh » Unassigned
StatusFileSize
new2.01 KB

Hi Douglas Reith,

Created clean patch for same, can you please review & merge.
Thanks

makbul_khan8’s picture

Status: Needs work » Needs review
prasannag’s picture

Assigned: Unassigned » prasannag
prasannag’s picture

Assigned: prasannag » Unassigned
Status: Needs review » Reviewed & tested by the community

Hi Makbul, I have reviewed this patch and [user:validate-url] token works fine.

stevecowie’s picture

Status: Reviewed & tested by the community » Fixed
StatusFileSize
new2.69 KB

The patch at #16 applies but I made two slight alterations. One was to delete the todo related to setting the email tab. As acknowledged in 16, it's not working and I think it's better to get this applied and solve that problem later. I also made a slight related change to the field for permitting immediate login to make it clearer that you should only use that setting when allowing visitors to register without admin approval.

  • Jon Pugh authored 315afe9 on 7.x-1.x
    Issue #1381564 by makbul_khan8, stevecowie, Jon Pugh: Required...

Status: Fixed » Closed (fixed)

Automatically closed - issue fixed for 2 weeks with no activity.