- drop Bulma and Font Awesome, plain CSS built on charte.css - dashboard: GitHub-like calendar grouped by year, selected day panel (sticky side column on desktop, bottom bar on mobile), keyboard navigation - public page: today's mood and last months fit in one screen, journal hidden - day log page: mode picker as pills, illustration follows the chosen mode - login, password and invitation screens in French, global flash messages - add User#current_mode_since Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
21 lines
635 B
Ruby
21 lines
635 B
Ruby
class SessionsController < ApplicationController
|
|
allow_unauthenticated_access only: %i[ new create ]
|
|
rate_limit to: 10, within: 3.minutes, only: :create, with: -> { redirect_to new_session_url, alert: "Trop de tentatives. Réessayez dans quelques minutes." }
|
|
|
|
def new
|
|
end
|
|
|
|
def create
|
|
if user = User.authenticate_by(params.permit(:email_address, :password))
|
|
start_new_session_for user
|
|
redirect_to after_authentication_url
|
|
else
|
|
redirect_to new_session_path, alert: "Adresse mail ou mot de passe incorrect."
|
|
end
|
|
end
|
|
|
|
def destroy
|
|
terminate_session
|
|
redirect_to new_session_path
|
|
end
|
|
end
|