New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unable to login from Safari (Python 3) #73

Open
loleg opened this Issue Jan 24, 2017 · 1 comment

Comments

1 participant
@loleg
Copy link
Member

loleg commented Jan 24, 2017

On certain server configurations, a user of Safari browser was unable to login or register for an account. The server logs contain this message:

Exception on /login/ [GET]
Traceback (most recent call last):
  ...
  File "/srv/soda/dribdat/dribdat/public/auth.py", line 32, in login
 line 43, in process
    self.current_token = self.csrf_impl.generate_csrf_token(self)
  File "/srv/soda/dribdat/env/lib/python3.4/site-packages/flask_wtf/csrf.py", li
ne 134, in generate_csrf_token
    token_key=self.meta.csrf_field_name
  File "/srv/soda/dribdat/env/lib/python3.4/site-packages/flask_wtf/csrf.py", li
ne 47, in generate_csrf
    setattr(g, field_name, s.dumps(session[field_name]))
  ...
  File "/usr/lib/python3.4/json/encoder.py", line 173, in default
    raise TypeError(repr(o) + " is not JSON serializable")
TypeError: b'daefd4f311284ca5ce9cf4503bfba12c55918eb0' is not JSON serializable
127.0.0.1 - - [23/Jan/2017 17:38:04] "GET /login/ HTTP/1.0" 500 -

This could be related to this issue.

This happens only when running Dribdat on Python 3, and is related to string conversion (Unicode from octet).

Not sure why it only affects a specific browser, though.

@loleg loleg added the bug label Jan 24, 2017

@loleg loleg changed the title User unable to login from Safari browser Unable to login from Safari (Python 3) Feb 13, 2017

@loleg

This comment has been minimized.

Copy link
Member

loleg commented Feb 21, 2017

Looks like this is a Python 3 compatibility issue with the bcrypt library.

@loleg loleg added this to User Experience in Dribdat 2.0 Jul 17, 2017

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment