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)
|
||||
|
||||
@@ -0,0 +1,7 @@
|
||||
class ApplicationJob < ActiveJob::Base
|
||||
# Automatically retry jobs that encountered a deadlock
|
||||
# retry_on ActiveRecord::Deadlocked
|
||||
|
||||
# Most jobs are safe to ignore if the underlying records are no longer available
|
||||
# discard_on ActiveJob::DeserializationError
|
||||
end
|
||||
Reference in New Issue
Block a user