raddar 0.0.1.pre
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/MIT-LICENSE +20 -0
- data/README.md +3 -0
- data/Rakefile +27 -0
- data/app/assets/images/raddar/fallback/avatar/medium.png +0 -0
- data/app/assets/images/raddar/fallback/avatar/thumb.png +0 -0
- data/app/assets/javascripts/raddar/admin/dashboard.js.coffee +3 -0
- data/app/assets/javascripts/raddar/application.js +16 -0
- data/app/assets/javascripts/raddar/followerships.js.coffee +3 -0
- data/app/assets/javascripts/raddar/home.js.coffee +3 -0
- data/app/assets/javascripts/raddar/notifications.js.coffee +16 -0
- data/app/assets/javascripts/raddar/users.js.coffee +3 -0
- data/app/assets/javascripts/raddar/users/privacies.js.coffee +3 -0
- data/app/assets/stylesheets/raddar/admin/dashboard.css.scss +3 -0
- data/app/assets/stylesheets/raddar/application.css +14 -0
- data/app/assets/stylesheets/raddar/followerships.css.scss +3 -0
- data/app/assets/stylesheets/raddar/home.css.scss +3 -0
- data/app/assets/stylesheets/raddar/notifications.css.scss +6 -0
- data/app/assets/stylesheets/raddar/users.css.scss +3 -0
- data/app/assets/stylesheets/raddar/users/privacies.css.scss +3 -0
- data/app/controllers/raddar/admin/dashboard_controller.rb +11 -0
- data/app/controllers/raddar/admin/users_controller.rb +34 -0
- data/app/controllers/raddar/application_controller.rb +17 -0
- data/app/controllers/raddar/followerships_controller.rb +60 -0
- data/app/controllers/raddar/home_controller.rb +8 -0
- data/app/controllers/raddar/notifications_controller.rb +31 -0
- data/app/controllers/raddar/users/email_preferences_controller.rb +24 -0
- data/app/controllers/raddar/users/external_accounts_controller.rb +18 -0
- data/app/controllers/raddar/users/omniauth_callbacks_controller.rb +30 -0
- data/app/controllers/raddar/users/passwords_controller.rb +22 -0
- data/app/controllers/raddar/users/privacies_controller.rb +25 -0
- data/app/controllers/raddar/users/registrations_controller.rb +51 -0
- data/app/controllers/raddar/users/sessions_controller.rb +11 -0
- data/app/controllers/raddar/users_controller.rb +8 -0
- data/app/helpers/raddar/admin/dashboard_helper.rb +4 -0
- data/app/helpers/raddar/application_helper.rb +4 -0
- data/app/helpers/raddar/notifications_helper.rb +19 -0
- data/app/helpers/raddar/users/privacies_helper.rb +4 -0
- data/app/mailers/raddar/notification_mailer.rb +16 -0
- data/app/models/raddar/external_account.rb +12 -0
- data/app/models/raddar/followership.rb +20 -0
- data/app/models/raddar/followership_completion.rb +37 -0
- data/app/models/raddar/notification.rb +10 -0
- data/app/models/raddar/omniauth_completion.rb +83 -0
- data/app/models/raddar/role.rb +7 -0
- data/app/models/raddar/user.rb +70 -0
- data/app/policies/raddar/admin/dashboard_policy.rb +7 -0
- data/app/policies/raddar/admin/user_policy.rb +15 -0
- data/app/policies/raddar/application_policy.rb +42 -0
- data/app/policies/raddar/followership_policy.rb +25 -0
- data/app/policies/raddar/notification_policy.rb +21 -0
- data/app/policies/raddar/user_policy.rb +17 -0
- data/app/uploaders/raddar/avatar_uploader.rb +56 -0
- data/app/views/layouts/raddar/_alerts.html.erb +3 -0
- data/app/views/layouts/raddar/_navbar.html.erb +22 -0
- data/app/views/layouts/raddar/_notifications.html.erb +20 -0
- data/app/views/layouts/raddar/_user_menu.html.erb +21 -0
- data/app/views/layouts/raddar/application.html.erb +21 -0
- data/app/views/layouts/raddar/notification_mailer.html.erb +12 -0
- data/app/views/raddar/admin/dashboard/index.html.erb +6 -0
- data/app/views/raddar/admin/users/index.html.erb +11 -0
- data/app/views/raddar/admin/users/show.html.erb +12 -0
- data/app/views/raddar/followerships/followers.html.erb +9 -0
- data/app/views/raddar/followerships/following.html.erb +9 -0
- data/app/views/raddar/home/index.html.erb +1 -0
- data/app/views/raddar/notification_mailer/new_follower.html.erb +11 -0
- data/app/views/raddar/notifications/index.html.erb +12 -0
- data/app/views/raddar/notifications/index.json.jbuilder +4 -0
- data/app/views/raddar/users/confirmations/new.html.erb +16 -0
- data/app/views/raddar/users/email_preferences/edit.html.erb +11 -0
- data/app/views/raddar/users/external_accounts/index.html.erb +14 -0
- data/app/views/raddar/users/mailer/confirmation_instructions.html.erb +5 -0
- data/app/views/raddar/users/mailer/reset_password_instructions.html.erb +8 -0
- data/app/views/raddar/users/mailer/unlock_instructions.html.erb +7 -0
- data/app/views/raddar/users/passwords/change.html.erb +13 -0
- data/app/views/raddar/users/passwords/edit.html.erb +19 -0
- data/app/views/raddar/users/passwords/new.html.erb +15 -0
- data/app/views/raddar/users/privacies/edit.html.erb +12 -0
- data/app/views/raddar/users/registrations/destroy.html.erb +13 -0
- data/app/views/raddar/users/registrations/edit.html.erb +30 -0
- data/app/views/raddar/users/registrations/new.html.erb +16 -0
- data/app/views/raddar/users/sessions/new.html.erb +13 -0
- data/app/views/raddar/users/shared/_links.erb +25 -0
- data/app/views/raddar/users/show.html.erb +52 -0
- data/app/views/raddar/users/unlocks/new.html.erb +16 -0
- data/config/cucumber.yml +8 -0
- data/config/initializers/carrierwave.rb +10 -0
- data/config/initializers/devise.rb +262 -0
- data/config/initializers/kaminari_config.rb +10 -0
- data/config/initializers/simple_form.rb +142 -0
- data/config/initializers/simple_form_bootstrap.rb +17 -0
- data/config/locales/devise.en.yml +59 -0
- data/config/locales/en.yml +49 -0
- data/config/locales/flash.en.yml +20 -0
- data/config/locales/mailers.en.yml +5 -0
- data/config/locales/simple_form.en.yml +35 -0
- data/config/locales/views.en.yml +36 -0
- data/config/routes.rb +43 -0
- data/db/migrate/20130824222728_devise_create_raddar_users.rb +66 -0
- data/db/migrate/20131013222926_create_raddar_followerships.rb +14 -0
- data/db/migrate/20131020174318_create_raddar_roles.rb +11 -0
- data/db/migrate/20131020175354_create_join_table_raddar_role_user.rb +8 -0
- data/db/migrate/20131021134623_create_raddar_notifications.rb +13 -0
- data/db/migrate/20131026133924_create_raddar_external_accounts.rb +23 -0
- data/lib/raddar.rb +15 -0
- data/lib/raddar/engine.rb +5 -0
- data/lib/raddar/hstore_serializer.rb +22 -0
- data/lib/raddar/version.rb +3 -0
- data/lib/tasks/cucumber.rake +65 -0
- data/lib/tasks/raddar_tasks.rake +4 -0
- metadata +390 -0
@@ -0,0 +1,12 @@
|
|
1
|
+
<h1><%= t '.title' %></h1>
|
2
|
+
|
3
|
+
<%= simple_form_for(@user, url: user_privacy_path, method: :patch) do |f| %>
|
4
|
+
<%= f.simple_fields_for(:privacy) do |p| %>
|
5
|
+
<% @user.privacy_keys.each do |key| %>
|
6
|
+
<%= p.input key, collection: ['public', 'only_me'], include_blank: false,
|
7
|
+
label_method: ->(o){ t(".options.#{o}") }, selected: @user.privacy[key] %>
|
8
|
+
<% end %>
|
9
|
+
<% end %>
|
10
|
+
|
11
|
+
<%= f.button :submit, t('.submit') %>
|
12
|
+
<% end %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<h1><%= t '.title' %></h1>
|
2
|
+
|
3
|
+
<div class="alert alert-danger">
|
4
|
+
<%= t '.alert' %>
|
5
|
+
</div>
|
6
|
+
|
7
|
+
<%= simple_form_for(@user, url: raddar.user_registration_path, method: :delete) do |f| %>
|
8
|
+
<%= f.error_notification %>
|
9
|
+
|
10
|
+
<%= f.input :password, autocomplete: :off, required: true %>
|
11
|
+
|
12
|
+
<%= f.submit t('.submit'), class: 'btn btn-danger' %>
|
13
|
+
<% end %>
|
@@ -0,0 +1,30 @@
|
|
1
|
+
<h2>Edit <%= resource_name.to_s.humanize %></h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, :as => resource_name, :url => registration_path(resource_name), :html => { :method => :put }) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
|
6
|
+
<%= f.input :name %>
|
7
|
+
<%= f.input :email %>
|
8
|
+
<%= f.input :gender, as: :radio_buttons, collection: [:female, :male] %>
|
9
|
+
<%= f.input :birthday, as: :string %>
|
10
|
+
<%= f.input :location %>
|
11
|
+
<%= f.input :bio, as: :text %>
|
12
|
+
|
13
|
+
<%= image_tag(@user.avatar.thumb.url) if @user.avatar? %>
|
14
|
+
<%= f.input :avatar, as: :file %>
|
15
|
+
<%= f.hidden_field :avatar_cache %>
|
16
|
+
|
17
|
+
<div class="form-group">
|
18
|
+
<%= f.button :submit, "Update" %>
|
19
|
+
</div>
|
20
|
+
<% end %>
|
21
|
+
|
22
|
+
<%= link_to t('raddar.users.passwords.change.title'), raddar.change_user_password_path %>
|
23
|
+
|
24
|
+
<%= link_to t('raddar.users.privacies.edit.title'), raddar.edit_user_privacy_path %>
|
25
|
+
|
26
|
+
<%= link_to t('raddar.users.email_preferences.edit.title'), raddar.edit_user_email_preferences_path %>
|
27
|
+
|
28
|
+
<%= link_to t('raddar.users.external_accounts.index.title'), raddar.user_external_accounts_path %>
|
29
|
+
|
30
|
+
<%= link_to t('raddar.users.registrations.destroy.title'), raddar.destroy_user_registration_path %>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<h2>Sign up</h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, as: resource_name, url: registration_path(resource_name)) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
|
6
|
+
<%= f.input :name, input_html: { class: 'form-control'} %>
|
7
|
+
<%= f.input :email, input_html: { class: 'form-control'} %>
|
8
|
+
<%= f.input :password, input_html: { class: 'form-control'} %>
|
9
|
+
<%= f.input :password_confirmation, input_html: { class: 'form-control'} %>
|
10
|
+
|
11
|
+
<div class="form-group">
|
12
|
+
<%= f.button :submit, "Sign up" %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= render "raddar/users/shared/links" %>
|
@@ -0,0 +1,13 @@
|
|
1
|
+
<h2>Sign in</h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, :as => resource_name, url: session_path(resource_name)) do |f| %>
|
4
|
+
<%= f.input :login, autofocus: true %>
|
5
|
+
<%= f.input :password %>
|
6
|
+
<%= f.input :remember_me, as: :boolean if devise_mapping.rememberable? %>
|
7
|
+
|
8
|
+
<div class="form-group">
|
9
|
+
<%= f.button :submit, "Sign in" %>
|
10
|
+
</div>
|
11
|
+
<% end %>
|
12
|
+
|
13
|
+
<%= render "raddar/users/shared/links" %>
|
@@ -0,0 +1,25 @@
|
|
1
|
+
<%- if controller_name != 'sessions' %>
|
2
|
+
<%= link_to "Sign in", new_session_path(resource_name) %><br />
|
3
|
+
<% end -%>
|
4
|
+
|
5
|
+
<%- if devise_mapping.registerable? && controller_name != 'registrations' %>
|
6
|
+
<%= link_to "Sign up", new_registration_path(resource_class) %><br />
|
7
|
+
<% end -%>
|
8
|
+
|
9
|
+
<%- if devise_mapping.recoverable? && controller_name != 'passwords' && controller_name != 'registrations' %>
|
10
|
+
<%= link_to "Forgot your password?", new_password_path(resource_name) %><br />
|
11
|
+
<% end -%>
|
12
|
+
|
13
|
+
<%- if devise_mapping.confirmable? && controller_name != 'confirmations' %>
|
14
|
+
<%= link_to "Didn't receive confirmation instructions?", new_confirmation_path(resource_name) %><br />
|
15
|
+
<% end -%>
|
16
|
+
|
17
|
+
<%- if devise_mapping.lockable? && resource_class.unlock_strategy_enabled?(:email) && controller_name != 'unlocks' %>
|
18
|
+
<%= link_to "Didn't receive unlock instructions?", new_unlock_path(resource_name) %><br />
|
19
|
+
<% end -%>
|
20
|
+
|
21
|
+
<%- if devise_mapping.omniauthable? %>
|
22
|
+
<%- resource_class.omniauth_providers.each do |provider| %>
|
23
|
+
<%= link_to "Sign in with #{provider.to_s.titleize}", raddar.user_omniauth_authorize_path(provider) %><br />
|
24
|
+
<% end -%>
|
25
|
+
<% end -%>
|
@@ -0,0 +1,52 @@
|
|
1
|
+
<div class='page-header'>
|
2
|
+
<h1><%= @user.name %></h1>
|
3
|
+
</div>
|
4
|
+
|
5
|
+
<% followership = @user.followers.where(user_id: current_user.id).first %>
|
6
|
+
<% if followership %>
|
7
|
+
<%= link_to t('followership.unfollow'), [@user, followership], class: 'btn btn-danger', method: :delete %>
|
8
|
+
<% elsif @user != current_user %>
|
9
|
+
<%= link_to t('followership.follow'), user_followerships_path(@user), class: 'btn btn-default', method: :post %>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<%= link_to t('followership.followers'), user_followers_path(@user) %>
|
13
|
+
<%= link_to t('followership.following'), user_following_path(@user) %>
|
14
|
+
|
15
|
+
<p class='lead'>
|
16
|
+
<%= simple_format @user.bio %>
|
17
|
+
</p>
|
18
|
+
|
19
|
+
<%= image_tag @user.avatar.medium.url %>
|
20
|
+
|
21
|
+
<dl>
|
22
|
+
<% if policy(@user).read_field?(:email) %>
|
23
|
+
<dt><%= Raddar::User.human_attribute_name('email') %></dt>
|
24
|
+
<dd>
|
25
|
+
<%= @user.email %>
|
26
|
+
<% if @user == current_user && @user.pending_reconfirmation? %>
|
27
|
+
<em><%= t '.unconfirmed_email', email: @user.unconfirmed_email %></em>
|
28
|
+
<% end %>
|
29
|
+
</dd>
|
30
|
+
<% end %>
|
31
|
+
|
32
|
+
<% if policy(@user).read_field?(:gender) && @user.gender.present? %>
|
33
|
+
<dt><%= Raddar::User.human_attribute_name('gender') %></dt>
|
34
|
+
<dd><%= t @user.gender, scope: 'user.gender_options' %></dd>
|
35
|
+
<% end %>
|
36
|
+
|
37
|
+
<% if policy(@user).read_field?(:location) && @user.location.present? %>
|
38
|
+
<dt><%= Raddar::User.human_attribute_name('location') %></dt>
|
39
|
+
<dd><%= @user.location %></dd>
|
40
|
+
<% end %>
|
41
|
+
|
42
|
+
<% if policy(@user).read_field?(:birthday) && @user.birthday.present? %>
|
43
|
+
<dt><%= Raddar::User.human_attribute_name('birthday') %></dt>
|
44
|
+
<dd><%= l @user.birthday %></dd>
|
45
|
+
<% end %>
|
46
|
+
</dl>
|
47
|
+
|
48
|
+
<% @user.external_accounts.each do |account| %>
|
49
|
+
<% if policy(@user).read_field?(account.provider) %>
|
50
|
+
<%= link_to account.provider.titleize, account.url, target: '_blank' %>
|
51
|
+
<% end %>
|
52
|
+
<% end %>
|
@@ -0,0 +1,16 @@
|
|
1
|
+
<h2>Resend unlock instructions</h2>
|
2
|
+
|
3
|
+
<%= simple_form_for(resource, :as => resource_name, :url => unlock_path(resource_name), :html => { :method => :post }) do |f| %>
|
4
|
+
<%= f.error_notification %>
|
5
|
+
<%= f.full_error :unlock_token %>
|
6
|
+
|
7
|
+
<div class="form-inputs">
|
8
|
+
<%= f.input :email, :required => true, :autofocus => true %>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<div class="form-actions">
|
12
|
+
<%= f.button :submit, "Resend unlock instructions" %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
|
16
|
+
<%= render "users/shared/links" %>
|
data/config/cucumber.yml
ADDED
@@ -0,0 +1,8 @@
|
|
1
|
+
<%
|
2
|
+
rerun = File.file?('rerun.txt') ? IO.read('rerun.txt') : ""
|
3
|
+
rerun_opts = rerun.to_s.strip.empty? ? "--format #{ENV['CUCUMBER_FORMAT'] || 'progress'} features" : "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} #{rerun}"
|
4
|
+
std_opts = "--format #{ENV['CUCUMBER_FORMAT'] || 'pretty'} --strict --tags ~@wip -r features"
|
5
|
+
%>
|
6
|
+
default: <%= std_opts %> features
|
7
|
+
wip: --tags @wip:3 --wip features
|
8
|
+
rerun: <%= rerun_opts %> --format rerun --out rerun.txt --strict --tags ~@wip
|
@@ -0,0 +1,262 @@
|
|
1
|
+
# Use this hook to configure devise mailer, warden hooks and so forth.
|
2
|
+
# Many of these configuration options can be set straight in your model.
|
3
|
+
Devise.setup do |config|
|
4
|
+
# The secret key used by Devise. Devise uses this key to generate
|
5
|
+
# random tokens. Changing this key will render invalid all existing
|
6
|
+
# confirmation, reset password and unlock tokens in the database.
|
7
|
+
config.secret_key = '616a2a2b72674eadb3a9251209db8f4bc1b4311c7a85dd352d05bf54cacbf48129a4dc185aa458f7ead405c089abc9adc40d904da1f6791b47ddbde7a8c5e749'
|
8
|
+
|
9
|
+
# ==> Mailer Configuration
|
10
|
+
# Configure the e-mail address which will be shown in Devise::Mailer,
|
11
|
+
# note that it will be overwritten if you use your own mailer class
|
12
|
+
# with default "from" parameter.
|
13
|
+
config.mailer_sender = 'please-change-me-at-config-initializers-devise@example.com'
|
14
|
+
|
15
|
+
# Configure the class responsible to send e-mails.
|
16
|
+
# config.mailer = 'Devise::Mailer'
|
17
|
+
|
18
|
+
# ==> ORM configuration
|
19
|
+
# Load and configure the ORM. Supports :active_record (default) and
|
20
|
+
# :mongoid (bson_ext recommended) by default. Other ORMs may be
|
21
|
+
# available as additional gems.
|
22
|
+
require 'devise/orm/active_record'
|
23
|
+
|
24
|
+
# ==> Configuration for any authentication mechanism
|
25
|
+
# Configure which keys are used when authenticating a user. The default is
|
26
|
+
# just :email. You can configure it to use [:username, :subdomain], so for
|
27
|
+
# authenticating a user, both parameters are required. Remember that those
|
28
|
+
# parameters are used only when authenticating and not when retrieving from
|
29
|
+
# session. If you need permissions, you should implement that in a before filter.
|
30
|
+
# You can also supply a hash where the value is a boolean determining whether
|
31
|
+
# or not authentication should be aborted when the value is not present.
|
32
|
+
# config.authentication_keys = [ :email ]
|
33
|
+
|
34
|
+
# Configure parameters from the request object used for authentication. Each entry
|
35
|
+
# given should be a request method and it will automatically be passed to the
|
36
|
+
# find_for_authentication method and considered in your model lookup. For instance,
|
37
|
+
# if you set :request_keys to [:subdomain], :subdomain will be used on authentication.
|
38
|
+
# The same considerations mentioned for authentication_keys also apply to request_keys.
|
39
|
+
# config.request_keys = []
|
40
|
+
|
41
|
+
# Configure which authentication keys should be case-insensitive.
|
42
|
+
# These keys will be downcased upon creating or modifying a user and when used
|
43
|
+
# to authenticate or find a user. Default is :email.
|
44
|
+
config.case_insensitive_keys = [ :email ]
|
45
|
+
|
46
|
+
# Configure which authentication keys should have whitespace stripped.
|
47
|
+
# These keys will have whitespace before and after removed upon creating or
|
48
|
+
# modifying a user and when used to authenticate or find a user. Default is :email.
|
49
|
+
config.strip_whitespace_keys = [ :email ]
|
50
|
+
|
51
|
+
# Tell if authentication through request.params is enabled. True by default.
|
52
|
+
# It can be set to an array that will enable params authentication only for the
|
53
|
+
# given strategies, for example, `config.params_authenticatable = [:database]` will
|
54
|
+
# enable it only for database (email + password) authentication.
|
55
|
+
# config.params_authenticatable = true
|
56
|
+
|
57
|
+
# Tell if authentication through HTTP Auth is enabled. False by default.
|
58
|
+
# It can be set to an array that will enable http authentication only for the
|
59
|
+
# given strategies, for example, `config.http_authenticatable = [:token]` will
|
60
|
+
# enable it only for token authentication. The supported strategies are:
|
61
|
+
# :database = Support basic authentication with authentication key + password
|
62
|
+
# :token = Support basic authentication with token authentication key
|
63
|
+
# :token_options = Support token authentication with options as defined in
|
64
|
+
# http://api.rubyonrails.org/classes/ActionController/HttpAuthentication/Token.html
|
65
|
+
# config.http_authenticatable = false
|
66
|
+
|
67
|
+
# If http headers should be returned for AJAX requests. True by default.
|
68
|
+
# config.http_authenticatable_on_xhr = true
|
69
|
+
|
70
|
+
# The realm used in Http Basic Authentication. 'Application' by default.
|
71
|
+
# config.http_authentication_realm = 'Application'
|
72
|
+
|
73
|
+
# It will change confirmation, password recovery and other workflows
|
74
|
+
# to behave the same regardless if the e-mail provided was right or wrong.
|
75
|
+
# Does not affect registerable.
|
76
|
+
# config.paranoid = true
|
77
|
+
|
78
|
+
# By default Devise will store the user in session. You can skip storage for
|
79
|
+
# :http_auth and :token_auth by adding those symbols to the array below.
|
80
|
+
# Notice that if you are skipping storage for all authentication paths, you
|
81
|
+
# may want to disable generating routes to Devise's sessions controller by
|
82
|
+
# passing :skip => :sessions to `devise_for` in your config/routes.rb
|
83
|
+
config.skip_session_storage = [:http_auth]
|
84
|
+
|
85
|
+
# By default, Devise cleans up the CSRF token on authentication to
|
86
|
+
# avoid CSRF token fixation attacks. This means that, when using AJAX
|
87
|
+
# requests for sign in and sign up, you need to get a new CSRF token
|
88
|
+
# from the server. You can disable this option at your own risk.
|
89
|
+
# config.clean_up_csrf_token_on_authentication = true
|
90
|
+
|
91
|
+
# ==> Configuration for :database_authenticatable
|
92
|
+
# For bcrypt, this is the cost for hashing the password and defaults to 10. If
|
93
|
+
# using other encryptors, it sets how many times you want the password re-encrypted.
|
94
|
+
#
|
95
|
+
# Limiting the stretches to just one in testing will increase the performance of
|
96
|
+
# your test suite dramatically. However, it is STRONGLY RECOMMENDED to not use
|
97
|
+
# a value less than 10 in other environments.
|
98
|
+
config.stretches = Rails.env.test? ? 1 : 10
|
99
|
+
|
100
|
+
# Setup a pepper to generate the encrypted password.
|
101
|
+
# config.pepper = "2caa18db5445062c0fcb267623a23eab0d7541ac58be2df280ff424a4468daa15ed6804f08657d08eacd0db21ae4e2fd8012cce763d5a8d29a92899cdaf466f8"
|
102
|
+
|
103
|
+
# ==> Configuration for :confirmable
|
104
|
+
# A period that the user is allowed to access the website even without
|
105
|
+
# confirming his account. For instance, if set to 2.days, the user will be
|
106
|
+
# able to access the website for two days without confirming his account,
|
107
|
+
# access will be blocked just in the third day. Default is 0.days, meaning
|
108
|
+
# the user cannot access the website without confirming his account.
|
109
|
+
# config.allow_unconfirmed_access_for = 2.days
|
110
|
+
|
111
|
+
# A period that the user is allowed to confirm their account before their
|
112
|
+
# token becomes invalid. For example, if set to 3.days, the user can confirm
|
113
|
+
# their account within 3 days after the mail was sent, but on the fourth day
|
114
|
+
# their account can't be confirmed with the token any more.
|
115
|
+
# Default is nil, meaning there is no restriction on how long a user can take
|
116
|
+
# before confirming their account.
|
117
|
+
# config.confirm_within = 3.days
|
118
|
+
|
119
|
+
# If true, requires any email changes to be confirmed (exactly the same way as
|
120
|
+
# initial account confirmation) to be applied. Requires additional unconfirmed_email
|
121
|
+
# db field (see migrations). Until confirmed new email is stored in
|
122
|
+
# unconfirmed email column, and copied to email column on successful confirmation.
|
123
|
+
config.reconfirmable = true
|
124
|
+
|
125
|
+
# Defines which key will be used when confirming an account
|
126
|
+
# config.confirmation_keys = [ :email ]
|
127
|
+
|
128
|
+
# ==> Configuration for :rememberable
|
129
|
+
# The time the user will be remembered without asking for credentials again.
|
130
|
+
# config.remember_for = 2.weeks
|
131
|
+
|
132
|
+
# If true, extends the user's remember period when remembered via cookie.
|
133
|
+
# config.extend_remember_period = false
|
134
|
+
|
135
|
+
# Options to be passed to the created cookie. For instance, you can set
|
136
|
+
# :secure => true in order to force SSL only cookies.
|
137
|
+
# config.rememberable_options = {}
|
138
|
+
|
139
|
+
# ==> Configuration for :validatable
|
140
|
+
# Range for password length. Default is 8..128.
|
141
|
+
config.password_length = 8..128
|
142
|
+
|
143
|
+
# Email regex used to validate email formats. It simply asserts that
|
144
|
+
# one (and only one) @ exists in the given string. This is mainly
|
145
|
+
# to give user feedback and not to assert the e-mail validity.
|
146
|
+
# config.email_regexp = /\A[^@]+@[^@]+\z/
|
147
|
+
|
148
|
+
# ==> Configuration for :timeoutable
|
149
|
+
# The time you want to timeout the user session without activity. After this
|
150
|
+
# time the user will be asked for credentials again. Default is 30 minutes.
|
151
|
+
# config.timeout_in = 30.minutes
|
152
|
+
|
153
|
+
# If true, expires auth token on session timeout.
|
154
|
+
# config.expire_auth_token_on_timeout = false
|
155
|
+
|
156
|
+
# ==> Configuration for :lockable
|
157
|
+
# Defines which strategy will be used to lock an account.
|
158
|
+
# :failed_attempts = Locks an account after a number of failed attempts to sign in.
|
159
|
+
# :none = No lock strategy. You should handle locking by yourself.
|
160
|
+
# config.lock_strategy = :failed_attempts
|
161
|
+
|
162
|
+
# Defines which key will be used when locking and unlocking an account
|
163
|
+
# config.unlock_keys = [ :email ]
|
164
|
+
|
165
|
+
# Defines which strategy will be used to unlock an account.
|
166
|
+
# :email = Sends an unlock link to the user email
|
167
|
+
# :time = Re-enables login after a certain amount of time (see :unlock_in below)
|
168
|
+
# :both = Enables both strategies
|
169
|
+
# :none = No unlock strategy. You should handle unlocking by yourself.
|
170
|
+
# config.unlock_strategy = :both
|
171
|
+
|
172
|
+
# Number of authentication tries before locking an account if lock_strategy
|
173
|
+
# is failed attempts.
|
174
|
+
# config.maximum_attempts = 20
|
175
|
+
|
176
|
+
# Time interval to unlock the account if :time is enabled as unlock_strategy.
|
177
|
+
# config.unlock_in = 1.hour
|
178
|
+
|
179
|
+
# ==> Configuration for :recoverable
|
180
|
+
#
|
181
|
+
# Defines which key will be used when recovering the password for an account
|
182
|
+
# config.reset_password_keys = [ :email ]
|
183
|
+
|
184
|
+
# Time interval you can reset your password with a reset password key.
|
185
|
+
# Don't put a too small interval or your users won't have the time to
|
186
|
+
# change their passwords.
|
187
|
+
config.reset_password_within = 6.hours
|
188
|
+
|
189
|
+
# ==> Configuration for :encryptable
|
190
|
+
# Allow you to use another encryption algorithm besides bcrypt (default). You can use
|
191
|
+
# :sha1, :sha512 or encryptors from others authentication tools as :clearance_sha1,
|
192
|
+
# :authlogic_sha512 (then you should set stretches above to 20 for default behavior)
|
193
|
+
# and :restful_authentication_sha1 (then you should set stretches to 10, and copy
|
194
|
+
# REST_AUTH_SITE_KEY to pepper).
|
195
|
+
#
|
196
|
+
# Require the `devise-encryptable` gem when using anything other than bcrypt
|
197
|
+
# config.encryptor = :sha512
|
198
|
+
|
199
|
+
# ==> Configuration for :token_authenticatable
|
200
|
+
# Defines name of the authentication token params key
|
201
|
+
# config.token_authentication_key = :auth_token
|
202
|
+
|
203
|
+
# ==> Scopes configuration
|
204
|
+
# Turn scoped views on. Before rendering "sessions/new", it will first check for
|
205
|
+
# "users/sessions/new". It's turned off by default because it's slower if you
|
206
|
+
# are using only default views.
|
207
|
+
config.scoped_views = true
|
208
|
+
|
209
|
+
# Configure the default scope given to Warden. By default it's the first
|
210
|
+
# devise role declared in your routes (usually :user).
|
211
|
+
# config.default_scope = :user
|
212
|
+
|
213
|
+
# Set this configuration to false if you want /users/sign_out to sign out
|
214
|
+
# only the current scope. By default, Devise signs out all scopes.
|
215
|
+
# config.sign_out_all_scopes = true
|
216
|
+
|
217
|
+
# ==> Navigation configuration
|
218
|
+
# Lists the formats that should be treated as navigational. Formats like
|
219
|
+
# :html, should redirect to the sign in page when the user does not have
|
220
|
+
# access, but formats like :xml or :json, should return 401.
|
221
|
+
#
|
222
|
+
# If you have any extra navigational formats, like :iphone or :mobile, you
|
223
|
+
# should add them to the navigational formats lists.
|
224
|
+
#
|
225
|
+
# The "*/*" below is required to match Internet Explorer requests.
|
226
|
+
# config.navigational_formats = ['*/*', :html]
|
227
|
+
|
228
|
+
# The default HTTP method used to sign out a resource. Default is :delete.
|
229
|
+
config.sign_out_via = :delete
|
230
|
+
|
231
|
+
# ==> OmniAuth
|
232
|
+
# Add a new OmniAuth provider. Check the wiki for more information on setting
|
233
|
+
# up on your models and hooks.
|
234
|
+
# config.omniauth :github, 'APP_ID', 'APP_SECRET', :scope => 'user,public_repo'
|
235
|
+
config.omniauth :facebook, '241013482667583', '37f0bb84168eec69c5e1c22cca8d1bb0'
|
236
|
+
config.omniauth :twitter, 'J0EPDlsuco66yV3Iyq8lUQ', 'dXYYxOhx7YAQlpqHv7AEvcpAd4QOQUNp7CdwODGN4E'
|
237
|
+
|
238
|
+
# ==> Warden configuration
|
239
|
+
# If you want to use other strategies, that are not supported by Devise, or
|
240
|
+
# change the failure app, you can configure them inside the config.warden block.
|
241
|
+
#
|
242
|
+
# config.warden do |manager|
|
243
|
+
# manager.intercept_401 = false
|
244
|
+
# manager.default_strategies(:scope => :user).unshift :some_external_strategy
|
245
|
+
# end
|
246
|
+
|
247
|
+
# ==> Mountable engine configurations
|
248
|
+
# When using Devise inside an engine, let's call it `MyEngine`, and this engine
|
249
|
+
# is mountable, there are some extra configurations to be taken into account.
|
250
|
+
# The following options are available, assuming the engine is mounted as:
|
251
|
+
#
|
252
|
+
# mount MyEngine, at: '/my_engine'
|
253
|
+
#
|
254
|
+
# The router that invoked `devise_for`, in the example above, would be:
|
255
|
+
config.router_name = :raddar
|
256
|
+
#
|
257
|
+
# When using omniauth, Devise cannot automatically set Omniauth path,
|
258
|
+
# so you need to do it manually. For the users scope, it would be:
|
259
|
+
# config.omniauth_path_prefix = '/my_engine/users/auth'
|
260
|
+
|
261
|
+
config.parent_controller = 'Raddar::ApplicationController'
|
262
|
+
end
|