liquid_feedback_frontend

view app/main/_filter/20_session.lua @ 1511:f1258993d993

Fixed issue with oauth/session endpoint and samesite cookies
author bsw
date Thu Aug 20 13:44:54 2020 +0200 (2020-08-20)
parents 3e9b0f1adec3
children 4f182720a2ec
line source
1 local cookie = request.get_cookie{ name = config.cookie_name }
2 local cookie_samesite = request.get_cookie{ name = config.cookie_name_samesite }
4 if
5 cookie and cookie ~= cookie_samesite
6 and not (request.get_module() == "oauth" and request.get_view() == "session")
7 then
8 slot.put_into("error", _"Cookie error. Try restarting your web browser and login again.")
9 return
10 end
12 if cookie then
13 app.session = Session:by_ident(cookie)
14 end
15 if not app.session then
16 app.session = Session:new()
17 app.session:set_cookie()
18 end
20 locale.set{ lang = app.session.lang or config.default_lang or "en" }
22 if locale.get("lang") == "de" then
23 locale.set{
24 date_format = 'DD.MM.YYYY',
25 time_format = 'HH:MM{:SS} Uhr',
26 decimal_point = ','
27 }
28 end
30 execute.inner()

Impressum / About Us