2015-09-06 52 views
-1

我已經試過everithing開始本指南灰燼Rails的認證,並制定

https://adibsaad.com/blog/setting-up-ember-cli-with-a-rails-back-end-and-token-authentication-authorization

但仍不起作用以下。當我嘗試訪問受認證令牌保護的頁面時,服務器會給我「未經授權的401」。這裏

https://github.com/francescabarbazeni87/Ember-Devise-Simple-Auth-Example-

有我的服務器和客戶端的代碼。提前謝謝了。

+0

能否請您從控制檯 – Rigel

+0

粘貼您的HTTP請求,請考慮增加[小例子(http://stackoverflow.com/help/mcve)你的問題,而不是鏈接到外部網站。請參閱[「我如何問好問題」](http://stackoverflow.com/help/how-to-ask):幫助其他人重現問題部分。 – XLII

回答

0
class ApplicationController < ActionController::Base 
    before_filter :authenticate_user_from_token! 

    # Enter the normal Devise authentication path, 
    # using the token authenticated user if available 
    #before_filter :authenticate_user! <-----you dont need this line...delete or comment it out