web2py / py4web

Other
244 stars 126 forks source link

Login with Pam raise error for an existent action_token #905

Closed mbelletti closed 3 weeks ago

mbelletti commented 4 weeks ago

From scaffold app, enabling PamPlugin

USE_PAM = True

and trying to login will give this error:


  File "/Users/max/Documents/work/python/user/py4web/py4web/core.py", line 1040, in wrapper
    ret = func(*func_args, **func_kwargs)
  File "/Users/max/Documents/work/python/user/py4web/py4web/core.py", line 1025, in wrapper
    raise exception
  File "/Users/max/Documents/work/python/user/py4web/py4web/core.py", line 1001, in wrapper
    context["output"] = func(*args, **kwargs)
  File "/Users/max/Documents/work/python/user/py4web/py4web/utils/auth.py", line 1079, in _
    form=form_factory(), path=path, user=auth.get_user(), **env
  File "/Users/max/Documents/work/python/user/py4web/py4web/utils/auth.py", line 1628, in login
    user, error = self.auth.login(
  File "/Users/max/Documents/work/python/user/py4web/py4web/utils/auth.py", line 668, in login
    elif (user["action_token"] or "").startswith("pending-registration:"):
KeyError: 'action_token'

Traceback (most recent call last):
  File "/Users/max/Documents/work/python/user/py4web/py4web/core.py", line 1040, in wrapper
    ret = func(*func_args, **func_kwargs)
  File "/Users/max/Documents/work/python/user/py4web/py4web/core.py", line 1025, in wrapper
    raise exception
  File "/Users/max/Documents/work/python/user/py4web/py4web/core.py", line 1001, in wrapper
    context["output"] = func(*args, **kwargs)
  File "/Users/max/Documents/work/python/user/py4web/py4web/utils/auth.py", line 1079, in _
    form=form_factory(), path=path, user=auth.get_user(), **env
  File "/Users/max/Documents/work/python/user/py4web/py4web/utils/auth.py", line 1628, in login
    user, error = self.auth.login(
  File "/Users/max/Documents/work/python/user/py4web/py4web/utils/auth.py", line 668, in login
    elif (user["action_token"] or "").startswith("pending-registration:"):
KeyError: 'action_token'```