mirror of
https://github.com/ToolJet/ToolJet
synced 2026-05-06 14:58:27 +00:00
13 lines
383 B
Ruby
13 lines
383 B
Ruby
class AuthenticationController < ApplicationController
|
|
skip_before_action :authenticate_request
|
|
|
|
def authenticate
|
|
command = AuthenticateUser.call(params[:email], params[:password])
|
|
|
|
if command.success?
|
|
render json: { auth_token: command.result }
|
|
else
|
|
render json: { error: command.errors }, status: :unauthorized
|
|
end
|
|
end
|
|
end
|