pshute
pshute

Reputation: 61

web2py auth.settings appear to not be working

We have been running web2py for awhile on Ubuntu 14. We decided to make a fresh Ubuntu 18 server, install web2py (Version 2.20.4-stable) and copy the relevant pieces of our web2py application over to the new server. The various issues have been worked through and I can access web2py on the browser. However when I attempt to login to the portal I am getting the message "Registration needs verification". This should not be the case as we are turning these features off in our auth object. The code is here:

auth = Auth(db)
auth.define_tables(username=False, signature=False)
auth.settings.allow_basic_login = True
auth.settings.registration_requires_verification = False
auth.settings.registration_requires_approval = False
auth.settings.reset_password_requires_verification = True
auth.settings.actions_disabled.append('register')

I also added a def __ str __ in the Auth class so I could print out the object here are the relevant parts. Let me know if I missed something needed:

'keep_session_onlogin': True, 
 'keep_session_onlogout': False, 
 'logging_enabled': True, 
 'login_after_registration': False, 
 'login_email_validate': True, 
 'login_userfield': None, 
 'logout_onlogout': None, 
 'long_expiration': 2592000, 
 'ondelete': 'CASCADE', 
 'password_field': 'password', 
 'password_min_length': 4, 
 'registration_requires_approval': False, 
 'registration_requires_verification': False, 
 'renew_session_onlogin': True, 
 'renew_session_onlogout': True, 
 'table_event_name': 'auth_event', 
 'table_group_name': 'auth_group', 
 'table_membership_name': 'auth_membership', 
 'table_permission_name': 'auth_permission', 
 'table_user_name': 'auth_user', 
 'use_username': False, 
 'username_case_sensitive': True, 
 'allow_basic_login': True, 
 'allow_basic_login_only': False, 
 'allow_delete_accounts': False, 
 'alternate_requires_registration': False, 
 'auth_manager_role': None, 
 'auth_two_factor_enabled': False, 
 'auth_two_factor_tries_left': 3, 
 'bulk_register_enabled': False, 
 'captcha': None, 
 'cas_maps': None, 
 'client_side': True, 
 'formstyle': 'table3cols', 
 'hideerror': False, 
 'label_separator': ': ', 
 'login_after_password_change': True, 
 'login_captcha': None, 
 'login_specify_error': False, 
 'mailer': <gluon.tools.Mail object at 0x7f4d48f59780
 'manager_actions': {}, 
 'multi_login': False, 
 'on_failed_authentication': <function Auth.<lambda> at 0x7f4d48c83620
 'pre_registration_div': None, 
 'prevent_open_redirect_attacks': True, 
 'prevent_password_reset_attacks': True, 
 'profile_fields': None, 
 'register_captcha': None, 
 'register_fields': None, 
 'register_verify_password': True, 
 'remember_me_form': True, 
 'reset_password_requires_verification': True, 
 'retrieve_password_captcha': None, 
 'retrieve_username_captcha': None, 

My DB is up and running and I can login from apps outside of web2py. Any suggestions would be appreciated.

Upvotes: 0

Views: 145

Answers (1)

Bkamath
Bkamath

Reputation: 23

i think before you turned off registration verification , you must have signed up, so in auth_user table please check field "Registration key" is empty or there is something like text "pending". Removing text will fix the problem temporally.

main issue for your code changes not reflecting is compiled .pyc files

please delete or remove compiled files from app admin then make the changes and recompile. Web2py has no issues... any sort you reported, it must be these 2 manual errors. Please check these out.

Upvotes: 0

Related Questions