Add session & user management in the backend

This commit is contained in:
hannah.dagemark 2025-05-09 14:56:30 +02:00 committed by Hannah Dagemark
commit 372fe53947
12 changed files with 88 additions and 11 deletions

View file

@ -1,4 +1,14 @@
class ApplicationController < ActionController::Base
# Only allow modern browsers supporting webp images, web push, badges, import maps, CSS nesting, and CSS :has.
allow_browser versions: :modern
def logged_in?
if session[:user_id] then true else false end
end
def current_user
if logged_in?
session[:user_id]
end
end
end