|
|
@ -846,8 +846,13 @@ post "/login" do |env|
|
|
|
|
secure = false
|
|
|
|
secure = false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
env.response.cookies["SID"] = HTTP::Cookie.new(name: "SID", value: sid, expires: Time.now + 2.years,
|
|
|
|
if CONFIG.domain
|
|
|
|
secure: secure, http_only: true)
|
|
|
|
env.response.cookies["SID"] = HTTP::Cookie.new(name: "SID", domain: ".#{CONFIG.domain}", value: sid, expires: Time.now + 2.years,
|
|
|
|
|
|
|
|
secure: secure, http_only: true)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
env.response.cookies["SID"] = HTTP::Cookie.new(name: "SID", value: sid, expires: Time.now + 2.years,
|
|
|
|
|
|
|
|
secure: secure, http_only: true)
|
|
|
|
|
|
|
|
end
|
|
|
|
else
|
|
|
|
else
|
|
|
|
error_message = "Invalid username or password"
|
|
|
|
error_message = "Invalid username or password"
|
|
|
|
next templated "error"
|
|
|
|
next templated "error"
|
|
|
@ -891,8 +896,13 @@ post "/login" do |env|
|
|
|
|
secure = false
|
|
|
|
secure = false
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
env.response.cookies["SID"] = HTTP::Cookie.new(name: "SID", value: sid, expires: Time.now + 2.years,
|
|
|
|
if CONFIG.domain
|
|
|
|
secure: secure, http_only: true)
|
|
|
|
env.response.cookies["SID"] = HTTP::Cookie.new(name: "SID", domain: ".#{CONFIG.domain}", value: sid, expires: Time.now + 2.years,
|
|
|
|
|
|
|
|
secure: secure, http_only: true)
|
|
|
|
|
|
|
|
else
|
|
|
|
|
|
|
|
env.response.cookies["SID"] = HTTP::Cookie.new(name: "SID", value: sid, expires: Time.now + 2.years,
|
|
|
|
|
|
|
|
secure: secure, http_only: true)
|
|
|
|
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
|
|
|
|
env.redirect referer
|
|
|
|
env.redirect referer
|
|
|
|