snikket-im/snikket-web-portal

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

Opened this issue · 1 comments

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.

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.