stormpath-rails 1.0.0.beta.2 → 1.1.0.beta

Sign up to get free protection for your applications and to get access to all the features.
Files changed (89) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +12 -19
  3. data/.rspec +0 -1
  4. data/.travis.yml +4 -23
  5. data/Gemfile +18 -0
  6. data/README.md +163 -73
  7. data/Rakefile +18 -3
  8. data/app/assets/stylesheets/stormpath.css.scss +283 -0
  9. data/app/controllers/stormpath/rails/base_controller.rb +10 -0
  10. data/app/controllers/stormpath/rails/omniauth_controller.rb +11 -0
  11. data/app/controllers/stormpath/rails/passwords_controller.rb +56 -0
  12. data/app/controllers/stormpath/rails/sessions_controller.rb +52 -0
  13. data/app/controllers/stormpath/rails/users_controller.rb +65 -0
  14. data/app/helpers/social_helper.rb +13 -0
  15. data/app/views/layouts/stormpath.html.erb +31 -0
  16. data/app/views/passwords/edit.html.erb +0 -0
  17. data/app/views/passwords/email_sent.html.erb +15 -0
  18. data/app/views/passwords/forgot.html.erb +33 -0
  19. data/app/views/passwords/forgot_change.html.erb +38 -0
  20. data/app/views/passwords/forgot_change_failed.html.erb +14 -0
  21. data/app/views/passwords/forgot_complete.html.erb +19 -0
  22. data/app/views/sessions/_facebook_login_form.erb +31 -0
  23. data/app/views/sessions/_form.html.erb +31 -0
  24. data/app/views/sessions/_google_login_form.html.erb +3 -0
  25. data/app/views/sessions/_social_auth.html.erb +7 -0
  26. data/app/views/sessions/new.html.erb +21 -0
  27. data/app/views/users/_form.html.erb +43 -0
  28. data/app/views/users/new.html.erb +10 -0
  29. data/app/views/users/verification_complete.html.erb +20 -0
  30. data/app/views/users/verification_email_sent.html.erb +15 -0
  31. data/app/views/users/verification_failed.html.erb +14 -0
  32. data/app/views/users/verification_resend.html.erb +14 -0
  33. data/bin/console +14 -0
  34. data/bin/rails +12 -0
  35. data/bin/rake +16 -0
  36. data/bin/rspec +16 -0
  37. data/bin/setup +8 -0
  38. data/config/initializers/assets.rb +1 -0
  39. data/config/routes.rb +16 -0
  40. data/lib/generators/stormpath/install/install_generator.rb +114 -0
  41. data/lib/generators/stormpath/install/templates/db/migrate/add_stormpath_to_users.rb +21 -0
  42. data/lib/generators/stormpath/install/templates/db/migrate/create_users.rb +12 -0
  43. data/lib/generators/stormpath/install/templates/stormpath.rb +4 -0
  44. data/lib/generators/stormpath/install/templates/user.rb +3 -0
  45. data/lib/generators/stormpath/routes/routes_generator.rb +23 -0
  46. data/lib/generators/stormpath/routes/templates/routes.rb +5 -0
  47. data/lib/generators/stormpath/views/USAGE +11 -0
  48. data/lib/generators/stormpath/views/views_generator.rb +29 -0
  49. data/lib/stormpath/rails/account.rb +2 -116
  50. data/lib/stormpath/rails/account_status.rb +28 -0
  51. data/lib/stormpath/rails/authentication.rb +72 -0
  52. data/lib/stormpath/rails/authentication_status.rb +22 -0
  53. data/lib/stormpath/rails/client.rb +73 -60
  54. data/lib/stormpath/rails/configuration.rb +56 -0
  55. data/lib/stormpath/rails/controller.rb +13 -0
  56. data/lib/stormpath/rails/engine.rb +6 -0
  57. data/lib/stormpath/rails/session.rb +37 -0
  58. data/lib/stormpath/rails/social.rb +34 -0
  59. data/lib/stormpath/rails/user.rb +25 -0
  60. data/lib/stormpath/rails/user_config/api_key.rb +17 -0
  61. data/lib/stormpath/rails/user_config/application.rb +12 -0
  62. data/lib/stormpath/rails/user_config/facebook.rb +16 -0
  63. data/lib/stormpath/rails/user_config/forgot_password.rb +12 -0
  64. data/lib/stormpath/rails/user_config/google.rb +16 -0
  65. data/lib/stormpath/rails/user_config/id_site.rb +13 -0
  66. data/lib/stormpath/rails/user_config/login.rb +13 -0
  67. data/lib/stormpath/rails/user_config/logout.rb +13 -0
  68. data/lib/stormpath/rails/user_config/register.rb +13 -0
  69. data/lib/stormpath/rails/user_config/verify_email.rb +14 -0
  70. data/lib/stormpath/rails/version.rb +1 -2
  71. data/lib/stormpath/rails.rb +32 -0
  72. data/lib/stormpath/testing/helpers.rb +49 -0
  73. data/lib/stormpath-rails.rb +6 -1
  74. data/stormpath-rails.gemspec +22 -28
  75. metadata +97 -256
  76. data/.ruby-gemset +0 -1
  77. data/.ruby-version +0 -1
  78. data/CHANGES.md +0 -19
  79. data/Guardfile +0 -23
  80. data/LICENSE.txt +0 -22
  81. data/lib/generators/stormpath/rails/migration/migration_generator.rb +0 -17
  82. data/lib/generators/stormpath/rails/templates/update_account_model.rb +0 -10
  83. data/lib/stormpath/rails/railtie.rb +0 -13
  84. data/spec/client_spec.rb +0 -222
  85. data/spec/generators/migration_generator_spec.rb +0 -19
  86. data/spec/integration/active_record_spec.rb +0 -23
  87. data/spec/integration/mongoid_spec.rb +0 -19
  88. data/spec/spec_helper.rb +0 -96
  89. data/spec/support/stormpath_account_shared_examples.rb +0 -212
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b289033abb513d9e994d1bfeb04ddcec33a911fa
4
+ data.tar.gz: 54a32096ea8f4bfce9fb3fe57f70e0b25bb1b8e4
5
+ SHA512:
6
+ metadata.gz: 0e0e416a12431829b3ab4cdaa55f03ab3839151ecd1eafb94e33f9641b562e899e8ef2e8fa1af987b10626f31ffdb7a99b91d2507da4346a62ab4fcfea0ba2af
7
+ data.tar.gz: 6bc55ccd9eade571c90e3c1540354709c4aaf0e681882f6fa241677798906aaacc8a7a50ed18ab828ff4d3c03887c0640e0f49fbf3d19d096597b63a57c41506
data/.gitignore CHANGED
@@ -1,20 +1,13 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .idea
5
- .config
6
- .yardoc
7
- .rvmrc
8
- Gemfile.lock
9
- InstalledFiles
10
- _yardoc
11
- coverage
12
- doc/
13
- lib/bundler/man
14
- pkg
15
- rdoc
16
- spec/reports
17
- test/tmp
18
- test/version_tmp
19
- tmp/
1
+ /.bundle/
2
+ /.yardoc
3
+ /Gemfile.lock
4
+ /_yardoc/
5
+ /coverage/
6
+ /doc/
7
+ /pkg/
8
+ /spec/reports/
9
+ /tmp/
20
10
  spec/fixtures/vcr_cassettes
11
+ spec/dummy/db/development.sqlite3
12
+ spec/dummy/log/development.log
13
+ spec/dummy/log/test.log
data/.rspec CHANGED
@@ -1,2 +1 @@
1
1
  --color
2
- --format progress
data/.travis.yml CHANGED
@@ -1,27 +1,8 @@
1
- ---
2
1
  language: ruby
3
2
  rvm:
4
- - 1.9.3
5
- gemfile:
6
- - Gemfile
7
- script: bundle exec rake spec
8
- services:
9
- - mongodb
3
+ - 2.1.5
10
4
  env:
11
5
  global:
12
- - secure: |-
13
- TFLI7BpxBBSoVV5x/tyr1iCqcQHcbzJeQPSR67J32VWbMDjM3mA9mz4SERvK
14
- j9VD7pEAknEBNpYUYdBR4Ut0m5/0F+XiX1eDOVMbfpmEefJ8e38CgGz7HZbu
15
- KdaWJhxTL8k/efyvJ+/UVPyzM4M0ADdyZIoDCDgRhj6AG5DqDJs=
16
- - secure: |-
17
- eu8VkY1iR5RYHvOobDQ7Miz8aG894F/BR/zEH8c3gpIhs7kItkBy0SKEMi5J
18
- A1yMlQsONU7aq6pbqiJEiBKSDWf9OOoFBxHYm46fop+xaLVLuuK484O9VzDW
19
- P6lV6Z06LolZaZsc2ENKf+2qfoO1XdN9gMTWD7QkT4x6OgRWiok=
20
- - secure: |-
21
- fMUOQUfUNkEDWmx5d4vIMIbqTuHIX1lu1PmbUnR25hHN9JFZnroxSvsvUlvH
22
- qB+GCk5q7kMuvqYC+Mbx0Ndb3NSuLSKYGYhHw/39ZyMPHgBhPKQyZuDiK3OJ
23
- g3Pv8Ot3lScgATu1lm5EzoGfN3ZVlSgmg5PJOwsafVaRlAUaHz4=
24
- - secure: |-
25
- UDTunvFjUyTaLHPa3iNOVwdAg37FzfKHRYdOiUoPH3aNA6pOgrtQYzkbhbJA
26
- chBcZBdD+SnEyY6PmI1NsLzcNrqBP3tdyH4c5vVy3KQAzc5TfU6RocWTrqRP
27
- FQKm/r0cbpjdydkpEzOKMk77Y56g6MTEk5cGFZjYoqhGKdz66O0=
6
+ - STORMPATH_APPLICATION_URL=https://api.stormpath.com/v1/applications/2RbTfV9wx59glWwChd9NQC
7
+ - secure: fYub1ieRk8lDfSmoZPP3yRdUSUAjYxt/gtyoMPm8iJUYCohzdD0nnVT308ycp0XPIRc87aGTOoH5B8SPnrXKG4RxxsZ6Wn8gW6PtHFoSnflEF7WqrkDkwIFk+RyQT4HVt0nDv5N/sSK10O5F3K5PzZog3GMDiCygzZ80uGhFNhU=
8
+ - secure: bMlph5RFUaH5A4Y9kuZOJE16GRRHBMY07VEHSEBCBSbdG0I2cNoOqMpe7DRLrZaVTPDZjF6FJiVt9vtBK7UEz9AQg5Ydqhp9GS+IwwZOnpvDPYRSsDWtrrTvZSgQjDciVrl0juShBuqb2gLEgdcYUivX4f2G4VsSMCbO3rQRwZw=
data/Gemfile CHANGED
@@ -1,3 +1,21 @@
1
1
  source 'https://rubygems.org'
2
2
 
3
+ # Specify your gem's dependencies in stormpath-rails.gemspec
3
4
  gemspec
5
+
6
+ gem 'sqlite3', '~> 1.3'
7
+
8
+ group :development do
9
+ gem 'pry'
10
+ gem 'pry-byebug'
11
+ end
12
+
13
+ group :test do
14
+ gem 'rspec-rails', '~> 3.3.1'
15
+ gem 'factory_girl_rails', '~> 4.5.0'
16
+ gem 'shoulda'
17
+ gem 'webmock'
18
+ gem 'vcr'
19
+ gem 'ammeter', git: "https://github.com/alexrothenberg/ammeter"
20
+ gem 'simplecov', :require => false
21
+ end
data/README.md CHANGED
@@ -1,107 +1,197 @@
1
- [![Build Status](https://secure.travis-ci.org/stormpath/stormpath-rails.png)](http://travis-ci.org/stormpath/stormpath-rails)
2
- [![Code Climate](https://codeclimate.com/github/stormpath/stormpath-rails.png)](https://codeclimate.com/github/stormpath/stormpath-rails)
3
- # Stormpath Rails Gem
1
+ [![Build Status](https://travis-ci.org/stormpath/stormpath-rails.svg?branch=master)](https://travis-ci.org/stormpath/stormpath-rails)
4
2
 
5
- Stormpath is the first easy, secure user management and authentication service for developers.
6
- This is the Rails gem to ease integration of its features with any Rails-based application.
3
+ # Stormpath-Rails-Gem
7
4
 
8
- ## Setup
5
+ Stormpath is the first easy, secure user management and authentication service for developers. This is the Rails gem to ease integration of its features with any Rails-based application.
9
6
 
10
- 1. Install the <code>stormpath-rails</code> gem, either via the command line:
7
+ Stormpath makes it incredibly simple to add users and user data to your application. It aims to completely abstract away all user registration, login, authentication, and authorization problems, and make building secure websites painless.
11
8
 
12
- ```
13
- $ gem install stormpath-rails
14
- ```
9
+ ## Installation
15
10
 
16
- or adding the gem to your [Bundler][bundler] Gemspec:
11
+ To get started, add Stormpath to your `Gemfile`, `bundle install`, and run
12
+ `install generator`:
17
13
 
18
- ```
19
- gem 'stormpath-rails'
20
- ```
14
+ To generate the inital config and setup files
15
+ ```sh
16
+ $ rails generate stormpath:install
17
+ ```
18
+
19
+ When you run the above generator, it:
20
+
21
+ * Inserts `Stormpath::Controller` into your `ApplicationController`
22
+ * Creates an initializer to allow further configuration.
23
+ * Creates a migration that either creates a users table or adds any necessary
24
+ columns to the existing table.
25
+
26
+ ## Configuration
27
+ Override any of these defaults in config/initializers/stormpath.rb
21
28
 
22
- or any other preferred dependency.
29
+ ```ruby
30
+ Stormpath::Rails.configure do |config|
31
+ config.api_key.file = ENV['STORMPATH_API_KEY_FILE_LOCATION']
32
+ config.application.href = ENV['STORMPATH_APPLICATION_HREF']
33
+ end
34
+ ```
35
+ The `STORMPATH_API_KEY_FILE_LOCATION` is the location of your Stormpath API Key file. Information about getting this file is found in the [Ruby Quickstart](http://docs.stormpath.com/ruby/quickstart/). The `STORMPATH_APPLICATION_HREF` represents the Application in Stormpath that is your Rails application. You can get the href from the Stormpath Admin Console or the API.
36
+
37
+ ## Useage
23
38
 
24
- 2. Create a [Stormpath][stormpath] developer account and [create your API Keys][create-api-keys]
25
- downloading the <code>apiKey.properties</code> file into a <code>.stormpath</code>
26
- folder under your local home directory. So that the Rails gem knows where to find this file,
27
- add an environment variable called STORMPATH\_API\_KEY\_FILE\_LOCATION whose value is the full
28
- path to this new .properties file:
39
+ ### Helper Methods
29
40
 
30
- ```sh
31
- export STORMPATH_API_KEY_FILE_LOCATION="/Users/john/.stormpath/apiKey.properties"
32
- ```
41
+ Use `current_user`, `signed_in?`, `signed_out?` in controllers, views, and helpers. For example:
42
+ ```erb
43
+ <% if signed_in? %>
44
+ <%= current_user.email %>
45
+ <%= button_to "Sign out", sign_out_path, method: :delete %>
46
+ <% else %>
47
+ <%= link_to "Sign in", sign_in_path %>
48
+ <% end %>
49
+ ```
33
50
 
34
- 3. Create an application and a directory to store your users' accounts through the
35
- [Stormpath Admin][stormpath-admin] interface. Make sure to add the newly-created
36
- directory as a Login Source for your newly-created Application.
51
+ ### Login
37
52
 
38
- 4. Through the [Stormpath Admin][stormpath-admin] interface, note your application's REST URL.
39
- You'll want to create an environment variable called STORMPATH\_APPLICATION\_URL whose value
40
- is this URL.
53
+ Stormpath Rails automaticly provides route to `/login`. If the attempt is successsfull, the user will be send to the next_uri whcih is by default `/` and create the propper session cookies.
41
54
 
42
- 5. Generate and run migration, if you're on ActiveRecord. Skip this step for Mongoid.
43
- ```sh
44
- rails g stormpath:rails:migration user
45
- rake db:migrate
46
- ```
55
+ If you wish to change this you can modify login options in configuration file:
47
56
 
48
- 6. Update your model file.
49
- ```ruby
50
- class User < ActiveRecord:Base
51
- include Stormpath::Rails::Account
57
+ ```ruby
58
+ Stormpath::Rails.configure do |config|
59
+ config.login do |c|
60
+ c.login = true
61
+ c.uri = '/login'
62
+ c.next_uri = '/'
52
63
  end
53
- ```
64
+ end
65
+ ```
54
66
 
55
- ## Testing
67
+ ### Logout
68
+ Stormpath Rails automaticly provides route to `/logout`.
56
69
 
57
- To run the test suite, simple run:
70
+ If you wish to change the logout URI or the next_uri, you can provide the following configuration
58
71
 
59
- ```sh
60
- $ rake spec
72
+ ```ruby
73
+ Stormpath::Rails.configure do |config|
74
+ config.logout do |c|
75
+ c.logout = true
76
+ c.uri = '/logout'
77
+ c.next_uri = '/'
78
+ end
79
+ end
61
80
  ```
62
81
 
63
- Note that this will make requests to the Stormpath API; you'll need to have set
64
- environment variables enabling the client to interact with your Stormpath
65
- account. You'll also need to have environment variables set that will enable
66
- the client to interact with a test directory and application.
82
+ ### Verify Email
83
+
84
+ By default verify email is disabled. Which means after user fills in the registration form and submits, if his credentials are valid, he will be automaticly logged in without email verification.
85
+
86
+ If you want to enable email verification you can add the following code to the configuration file.
67
87
 
68
- The test run will also generate a code-coverage report, viewable in the
69
- coverage subdirectory.
88
+ ```ruby
89
+ Stormpath::Rails.configure do |config|
90
+ config.verify_email do |c|
91
+ c.enabled = true
92
+ c.uri = '/verify'
93
+ c.next_uri = '/'
94
+ end
95
+ end
96
+ ```
70
97
 
71
- ## Contributing
98
+ If verify email set to enable after user registers he will first receive an email with the link and token with which he can verify his account. uri is the link which is used to verify the account and next_uri is location where user will be redirected after his account has been verified.
72
99
 
73
- You can make your own contributions by forking the <code>development</code>
74
- branch, making your changes, and issuing pull-requests on the
75
- <code>development</code> branch.
100
+ The email that is sent to the account is configurable through the Stormpath Admin Console.
76
101
 
77
- ## Building the Gem
102
+ ### Forgot Password
78
103
 
79
- To build and install the development branch yourself from the latest source:
104
+ By default forgot password is disabled. To enable it add the following code to the configuration file
80
105
 
106
+ ```ruby
107
+ Stormpath::Rails.configure do |config|
108
+ config.verify_email do |c|
109
+ c.enabled = true
110
+ c.uri = '/forgot'
111
+ end
112
+ end
81
113
  ```
82
- $ git clone git@github.com:stormpath/stormpath-rails.git
83
- $ cd stormpath-rails
84
- $ rake gem
85
- $ gem install pkg/stormpath-rails-{version}.gem
114
+
115
+ After the forgot password option has been enabled on the login form there will appear a link for user to reset his password. User first needs to enter an email to which a link will be send. When user clicks on a link he will be redirected to the final form where he can reset his password.
116
+
117
+ The email that is sent to the account is configurable through the Stormpath Admin Console.
118
+
119
+ ### ID Site
120
+
121
+ If you'd like to not worry about building your own registration and login screens at all, you can use Stormpath's new [ID site](https://docs.stormpath.com/guides/using-id-site/) feature. This is a hosted login subdomain which handles authentication for you automatically.
122
+
123
+ To make ID Site work in Rails, you need to change stormpath configuration file:
124
+
125
+ ```ruby
126
+ Stormpath::Rails.configure do |config|
127
+ config.id_site do |c|
128
+ c.enabled = true
129
+ c.uri = "/redirect"
130
+ c.next_uri = '/'
131
+ end
132
+ end
133
+ ```
134
+
135
+ When ID Site is enabled any request for `/login` or `/register` will cause a redirect to ID Site. When the user is finished at ID Site they will be redirected to uri which is defined in configuration, by default `/redirect`. Stormpath Rails will handle this request, and then redirect the user to `next_uri`
136
+
137
+ ### Social Login
138
+
139
+ Stormpath Rails supports social login as well. Currently only Facebook is supported, Providers for: Google, Github and Linkedin are currently in development.
140
+
141
+ In order to enable Facebook login you first you need to create a Facebook application and create a Facebook directory in your stormpath account. More info can be found [here](https://docs.stormpath.com/rest/product-guide/#integrating-with-facebook). After that you need to enable id from storm paths configuration file and provide facebook app_id and app_secret which is provided to you after Facebook app creation.
142
+
143
+ ```ruby
144
+ Stormpath::Rails.configure do |config|
145
+ config.facebook do |c|
146
+ c.app_id = 'app_id'
147
+ c.app_secret = 'app_secret'
148
+ end
149
+ end
86
150
  ```
87
151
 
88
- ## TODO
152
+ When user navigates to `/login` he will see a facebook login button. If he is authenticated succesfully he will be redirected back to rails root_path.
89
153
 
90
- + Automatic directory layout (test, development, production) creation
91
- + Preventive validation to not send invalid data to stormpath.
92
- + Preventive validation to not send invalid data to stormpath.
93
- + Solve n+1 request problem when requesting account collection.
154
+ ## Overriding Stormpath
94
155
 
95
- ## Copyright & Licensing
156
+ ### Routes
157
+ You can optionally run `rails generate stormpath:routes` to dump a copy of the default routes into your application for modification
96
158
 
97
- Copyright &copy; 2013 Stormpath, Inc. and contributors.
159
+ ```sh
160
+ rails generate stormpath:routes
161
+ ```
98
162
 
99
- This project is licensed under the [Apache 2.0 Open Source License](http://www.apache.org/licenses/LICENSE-2.0).
163
+ ### Controllers
164
+ To override a Stormpath controller, subclass it and update the routes to point to your new controller (see the "Routes" section).
165
+ ```ruby
166
+ class PasswordsController < Stormpath::PasswordsController
167
+ class SessionsController < Stormpath::SessionsController
168
+ class UsersController < Stormpath::UsersController
169
+ ```
100
170
 
101
- For additional information, please see the full [Project Documentation](https://www.stormpath.com/docs/ruby/product-guide).
171
+ ### Views
172
+ You can use the stormpath views generator to copy the default views to your application for modification.
173
+ ```sh
174
+ rails generate stormpath:views
175
+ ```
102
176
 
103
- [bundler]: http://gembundler.com/
104
- [stormpath]: http://stormpath.com/
105
- [create-api-keys]: http://www.stormpath.com/docs/ruby/product-guide#AssignAPIkeys
106
- [stormpath_bootstrap]: https://github.com/stormpath/stormpath-sdk-ruby/wiki/Bootstrapping-Stormpath
107
- [stormpath-admin]: https://api.stormpath.com/login
177
+ ```
178
+ app/views/layouts/stormpath.html.erb
179
+
180
+ app/views/passwords/edit.html.erb
181
+ app/views/passwords/email_sent.html.erb
182
+ app/views/passwords/forgot.html.erb
183
+ app/views/passwords/forgot_change.html.erb
184
+ app/views/passwords/forgot_change_failed.html.erb
185
+ app/views/passwords/forgot_complete.html.erb
186
+
187
+ app/views/sessions/_facebook_login_form.erb
188
+ app/views/sessions/_form.html.erb
189
+ app/views/sessions/new.html.erb
190
+
191
+ app/views/users/_form.html.erb
192
+ app/views/users/new.html.erb
193
+ app/views/users/verification_complete.html.erb
194
+ app/views/users/verification_email_sent.html.erb
195
+ app/views/users/verification_failed.html.erb
196
+ app/views/users/verification_resend.html.erb
197
+ ```
data/Rakefile CHANGED
@@ -1,7 +1,22 @@
1
+ require "rubygems"
2
+ require "bundler/setup"
1
3
  require "bundler/gem_tasks"
2
4
 
3
- require 'rspec/core/rake_task'
5
+ require "rake"
6
+ require "rspec/core/rake_task"
4
7
 
5
- RSpec::Core::RakeTask.new(:spec)
8
+ namespace :dummy do
9
+ require_relative "spec/dummy/config/application"
10
+ Dummy::Application.load_tasks
11
+ end
6
12
 
7
- task :default => :spec
13
+ APP_RAKEFILE = File.expand_path("../spec/dummy/Rakefile", __FILE__)
14
+ load 'rails/tasks/engine.rake'
15
+
16
+ Bundler::GemHelper.install_tasks
17
+
18
+ task :default => :spec
19
+
20
+ RSpec::Core::RakeTask.new(:spec) do |spec|
21
+ spec.pattern = 'spec/**/*_spec.rb'
22
+ end
@@ -0,0 +1,283 @@
1
+ html,
2
+ body {
3
+ height: 100%;
4
+ }
5
+ @media (max-width: 767px) {
6
+ html,
7
+ body {
8
+ padding: 0 4px;
9
+ }
10
+ }
11
+ body {
12
+ margin-left: auto;
13
+ margin-right: auto;
14
+ }
15
+ body,
16
+ div,
17
+ p,
18
+ a,
19
+ label {
20
+ font-family: "Open Sans";
21
+ font-size: 14px;
22
+ font-weight: 400;
23
+ color: #484848;
24
+ }
25
+ a {
26
+ color: #0072dd;
27
+ }
28
+ p {
29
+ line-height: 21px;
30
+ }
31
+ .container {
32
+ max-width: 620px;
33
+ }
34
+ .logo {
35
+ margin: 34px auto 25px auto;
36
+ display: block;
37
+ }
38
+ .btn-sp-green {
39
+ height: 45px;
40
+ line-height: 22.5px;
41
+ padding: 0 40px;
42
+ color: #fff;
43
+ font-size: 17px;
44
+ background: -webkit-linear-gradient(#42c41a 50%, #2dbd00 50%);
45
+ background: linear-gradient(#42c41a 50%, #2dbd00 50%);
46
+ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#2dbd00, endColorstr=#42c41a);
47
+ -ms-filter: "progid:DXImageTransform.Microsoft.gradient (GradientType=0, startColorstr=#2dbd00, endColorstr=#42c41a)";
48
+ }
49
+ .btn-sp-green:hover,
50
+ .btn-sp-green:focus {
51
+ color: #fff;
52
+ background: -webkit-linear-gradient(#43cd1a 50%, #2ec700 50%);
53
+ background: linear-gradient(#43cd1a 50%, #2ec700 50%);
54
+ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#2ec700, endColorstr=#43cd1a);
55
+ -ms-filter: "progid:DXImageTransform.Microsoft.gradient (GradientType=0, startColorstr=#2ec700, endColorstr=#43cd1a)";
56
+ }
57
+ .btn-social {
58
+ height: 37px;
59
+ line-height: 18.5px;
60
+ color: #fff;
61
+ font-size: 16px;
62
+ border-radius: 3px;
63
+ }
64
+ .btn-social:hover,
65
+ .btn-social:focus {
66
+ color: #fff;
67
+ }
68
+ .btn-facebook {
69
+ background: -webkit-linear-gradient(#4c6fc5 50%, #3d63c0 50%);
70
+ background: linear-gradient(#4c6fc5 50%, #3d63c0 50%);
71
+ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#3d63c0, endColorstr=#4c6fc5);
72
+ -ms-filter: "progid:DXImageTransform.Microsoft.gradient (GradientType=0, startColorstr=#3d63c0, endColorstr=#4c6fc5)";
73
+ }
74
+ .btn-facebook:hover,
75
+ .btn-facebook:focus {
76
+ color: #fff;
77
+ background: -webkit-linear-gradient(#4773de 50%, #3767db 50%);
78
+ background: linear-gradient(#4773de 50%, #3767db 50%);
79
+ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#3767db, endColorstr=#4773de);
80
+ -ms-filter: "progid:DXImageTransform.Microsoft.gradient (GradientType=0, startColorstr=#3767db, endColorstr=#4773de)";
81
+ }
82
+ .btn-google {
83
+ background: -webkit-linear-gradient(#e05b4b 50%, #dd4b39 50%);
84
+ background: linear-gradient(#e05b4b 50%, #dd4b39 50%);
85
+ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#dd4b39, endColorstr=#e05b4b);
86
+ -ms-filter: "progid:DXImageTransform.Microsoft.gradient (GradientType=0, startColorstr=#dd4b39, endColorstr=#e05b4b)";
87
+ }
88
+ .btn-google:hover,
89
+ .btn-google:focus {
90
+ color: #fff;
91
+ background: -webkit-linear-gradient(#ea604e 50%, #e8503c 50%);
92
+ background: linear-gradient(#ea604e 50%, #e8503c 50%);
93
+ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#e8503c, endColorstr=#ea604e);
94
+ -ms-filter: "progid:DXImageTransform.Microsoft.gradient (GradientType=0, startColorstr=#e8503c, endColorstr=#ea604e)";
95
+ }
96
+ .btn-register {
97
+ font-size: 16px;
98
+ }
99
+ .form-control {
100
+ font-size: 15px;
101
+ box-shadow: none;
102
+ }
103
+ .form-control::-webkit-input-placeholder {
104
+ color: #aaadb0;
105
+ }
106
+ .form-control::-moz-placeholder {
107
+ color: #aaadb0;
108
+ }
109
+ .form-control:-ms-input-placeholder {
110
+ color: #aaadb0;
111
+ }
112
+ .form-control::placeholder {
113
+ color: #aaadb0;
114
+ }
115
+ .form-control:focus {
116
+ box-shadow: inset 0 1px 1px rgba(0, 0, 0, 0.075), 0 0 6px rgba(0, 132, 255, 0.4);
117
+ }
118
+ .view .header {
119
+ padding: 34px 0;
120
+ }
121
+ .view .header,
122
+ .view .header a {
123
+ font-weight: 300;
124
+ font-size: 21px;
125
+ }
126
+ .view input[type="text"],
127
+ .view input[type="password"] {
128
+ background-color: #f6f6f6;
129
+ height: 45px;
130
+ }
131
+ .view a.forgot,
132
+ .view a.to-login {
133
+ float: right;
134
+ padding: 17px 0;
135
+ font-size: 13px;
136
+ }
137
+ .view form button {
138
+ display: block;
139
+ float: right;
140
+ margin-bottom: 25px;
141
+ }
142
+ .view form label {
143
+ height: 45px;
144
+ line-height: 45px;
145
+ }
146
+ .box {
147
+ box-shadow: 0 0px 3px 1px rgba(0, 0, 0, 0.1);
148
+ border: 1px solid #cacaca;
149
+ border-radius: 3px;
150
+ padding: 0 30px;
151
+ }
152
+ .sp-form .has-error,
153
+ .sp-form .has-error .help-block {
154
+ color: #ec3e3e;
155
+ font-weight: 600;
156
+ }
157
+ .sp-form .has-error input[type="text"],
158
+ .sp-form .has-error input[type="password"] {
159
+ border-color: #ec3e3e;
160
+ }
161
+ .sp-form .form-group {
162
+ margin-bottom: 21px;
163
+ }
164
+ .sp-form input[type="text"],
165
+ .sp-form input[type="password"] {
166
+ position: relative;
167
+ }
168
+ .sp-form .help-block {
169
+ font-size: 12px;
170
+ position: absolute;
171
+ top: 43px;
172
+ }
173
+ .verify-view .box {
174
+ padding-bottom: 30px;
175
+ }
176
+ .verify-view .box .header {
177
+ padding-bottom: 20px;
178
+ }
179
+ .unverified-view .box {
180
+ padding-bottom: 30px;
181
+ }
182
+ .unverified-view .box .header {
183
+ padding-bottom: 25px;
184
+ }
185
+ .login-view .box {
186
+ background-color: #f6f6f6;
187
+ padding: 0;
188
+ }
189
+ .login-view label {
190
+ margin-bottom: 7px;
191
+ }
192
+ .login-view .header p {
193
+ margin-top: 2em;
194
+ }
195
+ .login-view .email-password-area {
196
+ background-color: white;
197
+ border-top-left-radius: 3px;
198
+ border-bottom-left-radius: 3px;
199
+ }
200
+ @media (min-width: 767px) {
201
+ .login-view .email-password-area {
202
+ padding: 0 30px;
203
+ }
204
+ }
205
+ .login-view .email-password-area label {
206
+ height: 14px;
207
+ line-height: 14px;
208
+ }
209
+ .login-view .email-password-area input[type='checkbox'] {
210
+ visibility: hidden;
211
+ }
212
+ .login-view .email-password-area input[type='checkbox'] + label {
213
+ position: relative;
214
+ padding-left: 8px;
215
+ line-height: 16px;
216
+ font-size: 13px;
217
+ }
218
+ .login-view .email-password-area input[type='checkbox'] + label:after {
219
+ position: absolute;
220
+ left: -16px;
221
+ width: 16px;
222
+ height: 16px;
223
+ border: 1px solid #cacaca;
224
+ background-color: #f6f6f6;
225
+ content: "";
226
+ }
227
+ .login-view .email-password-area input[type='checkbox']:checked + label:after {
228
+ background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAYAAAAf8/9hAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAA2ZpVFh0WE1MOmNvbS5hZG9iZS54bXAAAAAAADw/eHBhY2tldCBiZWdpbj0i77u/IiBpZD0iVzVNME1wQ2VoaUh6cmVTek5UY3prYzlkIj8+IDx4OnhtcG1ldGEgeG1sbnM6eD0iYWRvYmU6bnM6bWV0YS8iIHg6eG1wdGs9IkFkb2JlIFhNUCBDb3JlIDUuMy1jMDExIDY2LjE0NTY2MSwgMjAxMi8wMi8wNi0xNDo1NjoyNyAgICAgICAgIj4gPHJkZjpSREYgeG1sbnM6cmRmPSJodHRwOi8vd3d3LnczLm9yZy8xOTk5LzAyLzIyLXJkZi1zeW50YXgtbnMjIj4gPHJkZjpEZXNjcmlwdGlvbiByZGY6YWJvdXQ9IiIgeG1sbnM6eG1wTU09Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC9tbS8iIHhtbG5zOnN0UmVmPSJodHRwOi8vbnMuYWRvYmUuY29tL3hhcC8xLjAvc1R5cGUvUmVzb3VyY2VSZWYjIiB4bWxuczp4bXA9Imh0dHA6Ly9ucy5hZG9iZS5jb20veGFwLzEuMC8iIHhtcE1NOk9yaWdpbmFsRG9jdW1lbnRJRD0ieG1wLmRpZDowRTVBQUVGMzJEODBFMjExODQ2N0NBMjk4MjdCNDBCNyIgeG1wTU06RG9jdW1lbnRJRD0ieG1wLmRpZDo0RTY4NUM4NURGNEYxMUUyQUE5QkExOTlGODU3RkFEOCIgeG1wTU06SW5zdGFuY2VJRD0ieG1wLmlpZDo0RTY4NUM4NERGNEYxMUUyQUE5QkExOTlGODU3RkFEOCIgeG1wOkNyZWF0b3JUb29sPSJBZG9iZSBQaG90b3Nob3AgQ1M2IChXaW5kb3dzKSI+IDx4bXBNTTpEZXJpdmVkRnJvbSBzdFJlZjppbnN0YW5jZUlEPSJ4bXAuaWlkOjQxNDQ4M0NEM0JERkUyMTE4MEYwQjNBRjIwMUNENzQxIiBzdFJlZjpkb2N1bWVudElEPSJ4bXAuZGlkOkZDMEMxNjY2OUVCMUUyMTFBRjVDQkQ0QjE5MTNERDU2Ii8+IDwvcmRmOkRlc2NyaXB0aW9uPiA8L3JkZjpSREY+IDwveDp4bXBtZXRhPiA8P3hwYWNrZXQgZW5kPSJyIj8+3YY4qgAAALlJREFUeNpi/P//PwMlgImBQjDwBrCgCwQHB+NUfObMGT9mZuboe/fuheM0ABu4fv060/fv32cBNTNycHBE4nUBNs0/f/7cAWSeMzQ0rCA5DICaNwKj+qGRkVEFUYF47ty5GWfPns2EsjsYGRlFgM5OJzoQ//37t5eLi2sRMMDec3Jypn79+lVXX1//H9HRaGJisvr379/nuLm5lwKdP9vMzOwZyekAaEA3EF8G4hZCYcQ4mhcYAAIMAJGST/dDIpNQAAAAAElFTkSuQmCC);
229
+ background-position: -1px -1px;
230
+ }
231
+ @media (min-width: 767px) {
232
+ .login-view .email-password-area.small {
233
+ border-right: 1px solid #cacaca;
234
+ }
235
+ .login-view .email-password-area.small .group-email {
236
+ margin-bottom: 21px;
237
+ }
238
+ }
239
+ @media (max-width: 767px) {
240
+ .login-view .email-password-area.small {
241
+ border-bottom: 1px solid #cacaca;
242
+ border-bottom-left-radius: 0;
243
+ border-bottom-right-radius: 0;
244
+ }
245
+ }
246
+ .login-view .email-password-area.large {
247
+ border-top-right-radius: 3px;
248
+ border-bottom-right-radius: 3px;
249
+ }
250
+ @media (min-width: 767px) {
251
+ .login-view .email-password-area.large {
252
+ padding: 0 50px;
253
+ }
254
+ .login-view .email-password-area.large .group-email label,
255
+ .login-view .email-password-area.large .group-password label {
256
+ height: 45px;
257
+ line-height: 45px;
258
+ }
259
+ }
260
+ .login-view .social-area {
261
+ border-top-right-radius: 3px;
262
+ border-bottom-right-radius: 3px;
263
+ padding: 0 20px;
264
+ position: relative;
265
+ padding-bottom: 20px;
266
+ background-color: #f6f6f6;
267
+ }
268
+ .login-view .social-area .header {
269
+ margin-bottom: -6px;
270
+ }
271
+ @media (max-width: 767px) {
272
+ .login-view .social-area .header {
273
+ padding: 0px;
274
+ }
275
+ }
276
+ .login-view .social-area button {
277
+ display: block;
278
+ width: 100%;
279
+ margin-bottom: 15px;
280
+ }
281
+ .login, .register { display: table; }
282
+ .va-wrapper { display: table-cell; width: 100%; vertical-align: middle; }
283
+ .custom-container { display: table-row; height: 100%; }