Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 42 lines (29 sloc) 1.764 kb
619c191 @NoamB adding new config style
authored
1 Sorcery::Controller::Config.submodules = [:user_activation, :http_basic_auth, :remember_me, :reset_password, :session_timeout, :brute_force_protection, :activity_logging, :external]
2
3 Sorcery::Controller::Config.configure do |config|
4 config.session_timeout = 10.minutes
5 config.session_timeout_from_last_action = false
6
7 config.controller_to_realm_map = {"application" => "Application", "users" => "Users"}
8
9 config.external_providers = [:twitter, :facebook]
10
11 config.twitter.key = "eYVNBjBDi33aa9GkA3w"
12 config.twitter.secret = "XpbeSdCoaKSmQGSeokz5qcUATClRW5u08QWNfv71N8"
13 config.twitter.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=twitter"
14 config.twitter.user_info_mapping = {:email => "screen_name"}
15
16 config.facebook.key = "34cebc81c08a521bc66e212f947d73ec"
17 config.facebook.secret = "5b458d179f61d4f036ee66a497ffbcd0"
18 config.facebook.callback_url = "http://0.0.0.0:3000/oauth/callback?provider=facebook"
19 config.facebook.user_info_mapping = {:email => "name"}
20
21 config.user_config do |user|
22 user.username_attribute_name = :email
23
24 user.user_activation_mailer = SorceryMailer
25
26 user.reset_password_mailer = SorceryMailer
27 user.reset_password_expiration_period = 10.minutes
28 user.reset_password_time_between_emails = nil
29
30 user.activity_timeout = 1.minutes
31
32 user.consecutive_login_retries_amount_limit = 10
33 user.login_lock_time_period = 2.minutes
34
35 user.authentications_class = Authentication
36 end
6391a52 @NoamB updating sorcery config with fix for #4
authored
37
38 config.user_class = User
619c191 @NoamB adding new config style
authored
39 end
40
41 include Sorcery::Controller::Adapters::Sinatra
42 include Sorcery::Controller
Something went wrong with that request. Please try again.