0
我已經擁有一個數據庫和其它的Rails應用程序沒有活動記錄的API,我還使用的ActiveResource來管理一些的數據庫查詢不能對視圖訪問法拉第PARAMS
我的前端應用程序控制器
class ApplicationController < ActionController::Base
protect_from_forgery with: :exception
skip_before_action :verify_authenticity_token
end
和我有一個動作從我的前端從前端我有這個方法驗證用戶到API
def create_session
conn = Faraday.new(:url => 'http://localhost:3001')
conn.post '/auth_user', { :email => params[:email], :password => params[:password] }
end
和API
def auth_user
user = User.find_by(email: params[:email])
if user && user.authenticate(params[:password])
conn = Faraday.new(:url => 'http://localhost:3000')
conn.post '/add_session', { :status => "right", :user => user.id }
else
conn = Faraday.new(:url => 'http://localhost:3000')
conn.post '/add_session', { :status => "wrong" }
end
末
請注意,我有機會獲得PARAMS [:電子郵件],而params [:密碼]我得到正確的狀態,以前端
然後在前端內我不能訪問paraeb [:狀態]或params [:用戶] excibelbyebug 我試圖做會話[:user_id] = PARAMS [:用戶],它不工作
我在這裏失蹤?