Skip to content
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

Untranslated and technical 'The CSRF token has expired.' message after failed login. #59

Open
mmigel opened this issue Feb 14, 2021 · 1 comment
Labels
blocked/external A feature in an external component is missing bug Something isn't working

Comments

@mmigel
Copy link
Contributor

mmigel commented Feb 14, 2021

Zrzut ekranu z 2021-02-14 15-41-48

Accidentally I found that untranslated and highly technical message after failed login. In my case I had login page in one tab for a few days, than I tried to login in without reloading it.

@horazont
Copy link
Collaborator

So I dug deep into this and I’ll defer a proper fix. Here’s a run down why this is complicated:

We use flask_wtf and wtforms to create all forms in the application. wtforms is a generic python library for handling (web) forms. It comes with translations for those technical strings.

flask_wtf is the integration glue between wtforms and quart, the web framework we are using. The problem is that flask_wtf overrides some strings (such as the one above) without providing its own translations. It is not clear to me why they do that, nor how to properly fix it.

Some other internal wtforms errors should be translated soon, though.

horazont added a commit that referenced this issue Mar 20, 2021
While this does *not* fix #59, it is a necessary first step to
address it properly. Please see the discussion in #59 why this is
not a sufficient fix.

Another shortcoming here is that we should probably forward *all*
languages accepted by the user agent to the form to provide the
best degration we can if the primary language picked by the user
is not offered by wtforms.
horazont added a commit that referenced this issue Mar 20, 2021
While this is not a solution for #59, it is a necessary first step
to address it properly. Please see the discussion in #59 why this
is not a sufficient fix.

Another shortcoming here is that we should probably forward *all*
languages accepted by the user agent to the form to provide the
best degration we can if the primary language picked by the user
is not offered by wtforms.
horazont added a commit that referenced this issue Mar 20, 2021
While this is not a solution for #59, it is a necessary first step
to address it properly. Please see the discussion in #59 why this
is not a sufficient fix.

Another shortcoming here is that we should probably forward *all*
languages accepted by the user agent to the form to provide the
best degration we can if the primary language picked by the user
is not offered by wtforms.
@horazont horazont added blocked/external A feature in an external component is missing bug Something isn't working labels Mar 20, 2021
horazont added a commit that referenced this issue Mar 20, 2021
While this is not a solution for #59, it is a necessary first step
to address it properly. Please see the discussion in #59 why this
is not a sufficient fix.

Another shortcoming here is that we should probably forward *all*
languages accepted by the user agent to the form to provide the
best degration we can if the primary language picked by the user
is not offered by wtforms.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocked/external A feature in an external component is missing bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants