add tests for controllers and ActionCable channels; improve main backend docs

This commit is contained in:
2026-10-27 10:32:40 +03:00
parent b122cbb652
commit 50e8aacfa9
17 changed files with 1127 additions and 63 deletions
@@ -2,7 +2,9 @@ class Api::SessionsController < ApplicationController
skip_before_action :authenticate_request!, only: [:create]
def create
user = User.authenticate_by(params.permit(:nickname, :password))
user = if params[:nickname].present? && params[:password].present?
User.authenticate_by(params.permit(:nickname, :password))
end
if user
token = JwtService.encode(user_id: user.id)