liquid_feedback_frontend

view app/main/oauth2/session.lua @ 1538:25ea15b4bd5e

Reworked cookie session control, exceptions for API
author bsw
date Tue Oct 20 17:48:49 2020 +0200 (2020-10-20)
parents 32cc544d5a5b
children
line source
1 if not request.is_post() then
2 return execute.view { module = "index", view = "405" }
3 end
5 slot.set_layout(nil, "application/json")
7 local r = json.object{
8 member_id = json.null
9 }
11 if app.session and app.session.member_id then
12 local origin = request.get_header("Origin")
13 if origin then
14 local system_applications = SystemApplication:by_origin(origin)
15 if #system_applications > 0 then
16 r.member_id = app.session.member_id
17 r.real_member_id = app.session.real_member_id
18 if app.session.member.role then
19 r.member_is_role = true
20 end
21 else
22 local member_application = MemberApplication:by_member_id_and_origin(app.session.member_id, origin)
23 if member_application then
24 r.member_id = app.session.member_id
25 r.real_member_id = app.session.real_member_id
26 end
27 end
28 end
29 end
31 slot.put_into("data", json.export(r))

Impressum / About Us