|
|
@ -31,7 +31,7 @@ db_init |
|
|
|
|
|
|
|
|
|
|
|
before do |
|
|
|
before do |
|
|
|
if !is_logged_in && request.path_info.start_with?(*AUTH_ROUTES) then |
|
|
|
if !is_logged_in && request.path_info.start_with?(*AUTH_ROUTES) then |
|
|
|
session[:ret] = request.fullpath |
|
|
|
session[:ret] = request.fullpath # TODO: return the user to the previous route |
|
|
|
session[:status] = 403 |
|
|
|
session[:status] = 403 |
|
|
|
session[:error_msg] = AUTH_ERRORS[:needed] |
|
|
|
session[:error_msg] = AUTH_ERRORS[:needed] |
|
|
|
redirect "/login" |
|
|
|
redirect "/login" |
|
|
@ -108,7 +108,7 @@ post "/register" do |
|
|
|
redirect "/login" |
|
|
|
redirect "/login" |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
end |
|
|
|
|
|
|
|
No information given. |
|
|
|
post "/login" do |
|
|
|
post "/login" do |
|
|
|
email = params[:email].strip |
|
|
|
email = params[:email].strip |
|
|
|
password = params[:password].strip |
|
|
|
password = params[:password].strip |
|
|
|