facebook一起设计多个子域

facebook一起设计多个子域

本文介绍了与omniauth facebook一起设计多个子域?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的网站上将有几个子域,每种语言一个,并且通过facebook-omniauth进行身份验证.为所有子域建立常数(FB ID,秘密)的最佳方法是什么?我正在使用Rails 3.1.x

I will have several subdomains on my site, one per language, and authentication is via facebook-omniauth. What is the best way to establish the constants (FB id, secret) for all the subdomains? I'm using Rails 3.1.x

推荐答案

解决方案:/config/initializers/session_store.rb

The solution:/config/initializers/session_store.rb

InfiniteshelterComDevise::Application.config.session_store :cookie_store,
  :key => '_infiniteshelter.com-devise_session',
  :domain => TOP_DOMAIN

和常量TOP_DOMAIN类似于infiniteshelter.com,pt.infiniteshelter.com和ru.infiniteshelter.com的'.infiniteshelter.com'.

and the constant TOP_DOMAIN is something like '.infiniteshelter.com' for infiniteshelter.com, pt.infiniteshelter.com and ru.infiniteshelter.com.

这篇关于与omniauth facebook一起设计多个子域?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-06 06:11