add tests for controllers and ActionCable channels; improve main backend docs
This commit is contained in:
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user