【问题标题】:Rails and Ember Simple AuthRails 和 Ember 简单身份验证
【发布时间】:2015-01-11 19:39:18
【问题描述】:

现在我正在学习 Ember,并使用 Devise 制作了一个简单的 Ruby on Rails 应用程序。
我通过这个manual 做所有事情。但它不起作用。
所以我发现了这个问题:#387 和 pull-request 我的问题可能已经解决了#394

所以我的问题是如何从主分支获取更改。
现在我这样做:

# Gemfile
source 'https://rails-assets.org'
gem 'rails-assets-ember-simple-auth'

但我不知道如何获取最新更改。 我也尝试将 repo 下载到 vendor 文件夹,但 Rails 不支持 ES6。

附:现在我做了一些改变让它在 Rails 中工作,但这不是一个好方法

# application_controller.rb
def authenticate_user_from_token!
  authenticate_with_http_token do |token, options|
    user_email = options[:user_email].presence
    user = user_email && User.find_by_email(user_email)
    token = token.split('"').last

    if user && Devise.secure_compare(user.authentication_token, token)
      sign_in user, store: false
    end
  end
end

【问题讨论】:

    标签: ruby-on-rails ember.js devise ember-simple-auth


    【解决方案1】:

    在下一个版本的 Ember Simple Auth 发布之前,您可以简单地保留此快速修复并稍后将其删除。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2017-04-24
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2020-08-28
      • 1970-01-01
      • 1970-01-01
      • 2014-06-24
      相关资源
      最近更新 更多