changing %(link)s

35 views
Skip to first unread message

Gualter Portella

unread,
Aug 19, 2018, 10:30:07 PM8/19/18
to web2py-users
Hi,

Can anybody provide me with specfic directions on how to do the following procedure:

In Auth, by default, email verification is disabled. To enable email, append the following lines in the model where auth is defined:

1
2
3
4
5
auth.settings.registration_requires_verification = True
auth.settings.registration_requires_approval = False
auth.settings.reset_password_requires_verification = True
auth.messages.verify_email = 'Click on the link %(link)s to verify your email'
auth.messages.reset_password = 'Click on the link %(link)s to reset your password'

In the two auth.messages above, you may need to replace the URL portion of the string with the proper complete URL of the action. This is necessary because web2py may be installed behind a proxy, and it cannot determine its own public URLs with absolute certainty. The above examples (which are the default values) should, however, work in most cases.


How can I change the %(link)s of lines 4 and 5 above. The app is in production, but still pointing to http://127.0.0.1:8000/user/verify_email


many thanks in advance,

Anthony

unread,
Aug 20, 2018, 8:36:55 AM8/20/18
to web2py-users
Just hard code it:

auth.messages.verify_email = 'Click on the link https://yourdomain.com/user/verify_email to verify your email'

Anthony

Gualter Portella

unread,
Aug 20, 2018, 11:12:29 AM8/20/18
to web...@googlegroups.com
Thanks, Anthony!

And what about the auth.messages.reset_password? It needs the hashcode to redirect to the specfic user, right?

Any ideas.

Once again thanks,

Cheers 

--
Resources:
- http://web2py.com
- http://web2py.com/book (Documentation)
- http://github.com/web2py/web2py (Source code)
- https://code.google.com/p/web2py/issues/list (Report Issues)
---
You received this message because you are subscribed to a topic in the Google Groups "web2py-users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/web2py/9zinYUcXA7w/unsubscribe.
To unsubscribe from this group and all its topics, send an email to web2py+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--
Gualter Portella

Anthony

unread,
Aug 20, 2018, 11:55:51 AM8/20/18
to web2py-users
It also has a "key" key available, so you can do:

auth.messages.reset_password = 'Click on the link https://yourdomain.com/user/reset_password?key=%(key)s to reset your password'

Anthony

Gualter Portella

unread,
Aug 20, 2018, 1:03:41 PM8/20/18
to web...@googlegroups.com
Great, Anthony!

You are a legend!

Thanks
Reply all
Reply to author
Forward
0 new messages