开发者

Getting OmniAuth provider settings

I have OmniAuth setup to use Twitter like so:

Rails.application.config.middleware.use OmniAuth::Builder do
  provider :twitter, 'key', 'secret'
end

How do 开发者_StackOverflow社区I retrieve the OmniAuth settings for the Twitter key and secret somewhere else my my app, like in a model?


Instead of inserting the key and secret in the middleware declaration as a string, you could setup a constant in an initializer and refer to the key/secret using the constant in both the middleware and elsewhere in your app.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜