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.
- checksums.yaml +7 -0
- data/.gitignore +12 -19
- data/.rspec +0 -1
- data/.travis.yml +4 -23
- data/Gemfile +18 -0
- data/README.md +163 -73
- data/Rakefile +18 -3
- data/app/assets/stylesheets/stormpath.css.scss +283 -0
- data/app/controllers/stormpath/rails/base_controller.rb +10 -0
- data/app/controllers/stormpath/rails/omniauth_controller.rb +11 -0
- data/app/controllers/stormpath/rails/passwords_controller.rb +56 -0
- data/app/controllers/stormpath/rails/sessions_controller.rb +52 -0
- data/app/controllers/stormpath/rails/users_controller.rb +65 -0
- data/app/helpers/social_helper.rb +13 -0
- data/app/views/layouts/stormpath.html.erb +31 -0
- data/app/views/passwords/edit.html.erb +0 -0
- data/app/views/passwords/email_sent.html.erb +15 -0
- data/app/views/passwords/forgot.html.erb +33 -0
- data/app/views/passwords/forgot_change.html.erb +38 -0
- data/app/views/passwords/forgot_change_failed.html.erb +14 -0
- data/app/views/passwords/forgot_complete.html.erb +19 -0
- data/app/views/sessions/_facebook_login_form.erb +31 -0
- data/app/views/sessions/_form.html.erb +31 -0
- data/app/views/sessions/_google_login_form.html.erb +3 -0
- data/app/views/sessions/_social_auth.html.erb +7 -0
- data/app/views/sessions/new.html.erb +21 -0
- data/app/views/users/_form.html.erb +43 -0
- data/app/views/users/new.html.erb +10 -0
- data/app/views/users/verification_complete.html.erb +20 -0
- data/app/views/users/verification_email_sent.html.erb +15 -0
- data/app/views/users/verification_failed.html.erb +14 -0
- data/app/views/users/verification_resend.html.erb +14 -0
- data/bin/console +14 -0
- data/bin/rails +12 -0
- data/bin/rake +16 -0
- data/bin/rspec +16 -0
- data/bin/setup +8 -0
- data/config/initializers/assets.rb +1 -0
- data/config/routes.rb +16 -0
- data/lib/generators/stormpath/install/install_generator.rb +114 -0
- data/lib/generators/stormpath/install/templates/db/migrate/add_stormpath_to_users.rb +21 -0
- data/lib/generators/stormpath/install/templates/db/migrate/create_users.rb +12 -0
- data/lib/generators/stormpath/install/templates/stormpath.rb +4 -0
- data/lib/generators/stormpath/install/templates/user.rb +3 -0
- data/lib/generators/stormpath/routes/routes_generator.rb +23 -0
- data/lib/generators/stormpath/routes/templates/routes.rb +5 -0
- data/lib/generators/stormpath/views/USAGE +11 -0
- data/lib/generators/stormpath/views/views_generator.rb +29 -0
- data/lib/stormpath/rails/account.rb +2 -116
- data/lib/stormpath/rails/account_status.rb +28 -0
- data/lib/stormpath/rails/authentication.rb +72 -0
- data/lib/stormpath/rails/authentication_status.rb +22 -0
- data/lib/stormpath/rails/client.rb +73 -60
- data/lib/stormpath/rails/configuration.rb +56 -0
- data/lib/stormpath/rails/controller.rb +13 -0
- data/lib/stormpath/rails/engine.rb +6 -0
- data/lib/stormpath/rails/session.rb +37 -0
- data/lib/stormpath/rails/social.rb +34 -0
- data/lib/stormpath/rails/user.rb +25 -0
- data/lib/stormpath/rails/user_config/api_key.rb +17 -0
- data/lib/stormpath/rails/user_config/application.rb +12 -0
- data/lib/stormpath/rails/user_config/facebook.rb +16 -0
- data/lib/stormpath/rails/user_config/forgot_password.rb +12 -0
- data/lib/stormpath/rails/user_config/google.rb +16 -0
- data/lib/stormpath/rails/user_config/id_site.rb +13 -0
- data/lib/stormpath/rails/user_config/login.rb +13 -0
- data/lib/stormpath/rails/user_config/logout.rb +13 -0
- data/lib/stormpath/rails/user_config/register.rb +13 -0
- data/lib/stormpath/rails/user_config/verify_email.rb +14 -0
- data/lib/stormpath/rails/version.rb +1 -2
- data/lib/stormpath/rails.rb +32 -0
- data/lib/stormpath/testing/helpers.rb +49 -0
- data/lib/stormpath-rails.rb +6 -1
- data/stormpath-rails.gemspec +22 -28
- metadata +97 -256
- data/.ruby-gemset +0 -1
- data/.ruby-version +0 -1
- data/CHANGES.md +0 -19
- data/Guardfile +0 -23
- data/LICENSE.txt +0 -22
- data/lib/generators/stormpath/rails/migration/migration_generator.rb +0 -17
- data/lib/generators/stormpath/rails/templates/update_account_model.rb +0 -10
- data/lib/stormpath/rails/railtie.rb +0 -13
- data/spec/client_spec.rb +0 -222
- data/spec/generators/migration_generator_spec.rb +0 -19
- data/spec/integration/active_record_spec.rb +0 -23
- data/spec/integration/mongoid_spec.rb +0 -19
- data/spec/spec_helper.rb +0 -96
- data/spec/support/stormpath_account_shared_examples.rb +0 -212
@@ -0,0 +1,11 @@
|
|
1
|
+
class Stormpath::Rails::OmniauthController < Stormpath::Rails::BaseController
|
2
|
+
def create
|
3
|
+
result = create_omniauth_user('facebook', params[:access_token])
|
4
|
+
user = find_or_create_user_from_account(result.account)
|
5
|
+
|
6
|
+
initialize_session user
|
7
|
+
set_flash_message :notice, "Successfully signed in"
|
8
|
+
|
9
|
+
redirect_to root_path
|
10
|
+
end
|
11
|
+
end
|
@@ -0,0 +1,56 @@
|
|
1
|
+
class Stormpath::Rails::PasswordsController < Stormpath::Rails::BaseController
|
2
|
+
before_filter :redirect_password_reset_disabled, only: :forgot
|
3
|
+
|
4
|
+
def forgot_send
|
5
|
+
result = reset_password(params[:password][:email])
|
6
|
+
|
7
|
+
if result.success?
|
8
|
+
render template: 'passwords/email_sent'
|
9
|
+
else
|
10
|
+
set_flash_message :error, "Invalid email address."
|
11
|
+
render template: 'passwords/forgot'
|
12
|
+
end
|
13
|
+
end
|
14
|
+
|
15
|
+
def forgot
|
16
|
+
render template: 'passwords/forgot'
|
17
|
+
end
|
18
|
+
|
19
|
+
def forgot_change
|
20
|
+
result = verify_email_token params[:sptoken]
|
21
|
+
|
22
|
+
if result.success?
|
23
|
+
@account_url = result.account_url
|
24
|
+
render template: "passwords/forgot_change"
|
25
|
+
else
|
26
|
+
render template: "passwords/forgot_change_failed"
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
def forgot_update
|
31
|
+
@account_url = params[:account_url]
|
32
|
+
if passwords_match?
|
33
|
+
result = update_password(params[:account_url], params[:password][:original])
|
34
|
+
if result.success?
|
35
|
+
render template: "passwords/forgot_complete"
|
36
|
+
else
|
37
|
+
set_flash_message :error, result.error_message
|
38
|
+
render template: "passwords/forgot_change"
|
39
|
+
end
|
40
|
+
|
41
|
+
else
|
42
|
+
set_flash_message :error, 'Passwords do not match.'
|
43
|
+
render template: "passwords/forgot_change"
|
44
|
+
end
|
45
|
+
end
|
46
|
+
|
47
|
+
private
|
48
|
+
|
49
|
+
def passwords_match?
|
50
|
+
params[:password][:original] == params[:password][:repeated]
|
51
|
+
end
|
52
|
+
|
53
|
+
def redirect_password_reset_disabled
|
54
|
+
redirect_to root_path unless configuration.forgot_password.enabled
|
55
|
+
end
|
56
|
+
end
|
@@ -0,0 +1,52 @@
|
|
1
|
+
class Stormpath::Rails::SessionsController < Stormpath::Rails::BaseController
|
2
|
+
before_filter :redirect_signed_in_users, only: :new
|
3
|
+
|
4
|
+
def create
|
5
|
+
result = authenticate user_from_params
|
6
|
+
|
7
|
+
if result.success?
|
8
|
+
@user = find_user_by_email params[:session][:email]
|
9
|
+
initialize_session(@user)
|
10
|
+
|
11
|
+
redirect_to configuration.login.next_uri, notice: 'Successfully signed in'
|
12
|
+
else
|
13
|
+
set_flash_message :error, result.error_message
|
14
|
+
render template: "sessions/new"
|
15
|
+
end
|
16
|
+
end
|
17
|
+
|
18
|
+
def destroy
|
19
|
+
logout
|
20
|
+
set_flash_message :notice, 'You have been logged out successfully.'
|
21
|
+
redirect_to configuration.logout.next_uri
|
22
|
+
end
|
23
|
+
|
24
|
+
def new
|
25
|
+
if configuration.id_site.enabled?
|
26
|
+
redirect_to id_site_login_url
|
27
|
+
else
|
28
|
+
render template: "sessions/new"
|
29
|
+
end
|
30
|
+
end
|
31
|
+
|
32
|
+
def redirect
|
33
|
+
user_data = handle_id_site_callback(request.url)
|
34
|
+
@user = find_user_by_email user_data.email
|
35
|
+
initialize_session(@user)
|
36
|
+
|
37
|
+
redirect_to configuration.id_site.next_uri, notice: 'Successfully signed in'
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def user_from_params
|
43
|
+
::User.new.tap do |user|
|
44
|
+
user.email = params[:session][:email]
|
45
|
+
user.password = params[:session][:password]
|
46
|
+
end
|
47
|
+
end
|
48
|
+
|
49
|
+
def redirect_signed_in_users
|
50
|
+
redirect_to root_path if signed_in?
|
51
|
+
end
|
52
|
+
end
|
@@ -0,0 +1,65 @@
|
|
1
|
+
class Stormpath::Rails::UsersController < Stormpath::Rails::BaseController
|
2
|
+
def create
|
3
|
+
@user = user_from_params
|
4
|
+
result = create_stormpath_account @user
|
5
|
+
|
6
|
+
if result.success?
|
7
|
+
@user.save
|
8
|
+
|
9
|
+
if configuration.verify_email.enabled?
|
10
|
+
render template: "users/verification_email_sent"
|
11
|
+
else
|
12
|
+
initialize_session(@user)
|
13
|
+
set_flash_message :notice, 'Your account was created successfully'
|
14
|
+
redirect_to configuration.register.next_uri
|
15
|
+
end
|
16
|
+
else
|
17
|
+
set_flash_message :error, result.error_message
|
18
|
+
render template: "users/new"
|
19
|
+
end
|
20
|
+
end
|
21
|
+
|
22
|
+
def new
|
23
|
+
if configuration.id_site.enabled?
|
24
|
+
redirect_to id_site_register_url
|
25
|
+
else
|
26
|
+
if signed_in?
|
27
|
+
redirect_to root_path
|
28
|
+
else
|
29
|
+
@user = user_from_params
|
30
|
+
render template: "users/new"
|
31
|
+
end
|
32
|
+
end
|
33
|
+
end
|
34
|
+
|
35
|
+
def verify
|
36
|
+
result = verify_email_token params[:sptoken]
|
37
|
+
|
38
|
+
if result.success?
|
39
|
+
@account_url = result.account_url
|
40
|
+
render template: "users/verification_complete"
|
41
|
+
else
|
42
|
+
render template: "users/verification_failed"
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
private
|
47
|
+
|
48
|
+
def user_from_params
|
49
|
+
email = user_params.delete(:email)
|
50
|
+
password = user_params.delete(:password)
|
51
|
+
given_name = user_params.delete(:given_name)
|
52
|
+
surname = user_params.delete(:surname)
|
53
|
+
|
54
|
+
::User.new.tap do |user|
|
55
|
+
user.email = email
|
56
|
+
user.password = password
|
57
|
+
user.given_name = given_name
|
58
|
+
user.surname = surname
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
62
|
+
def user_params
|
63
|
+
params[:user] || Hash.new
|
64
|
+
end
|
65
|
+
end
|
@@ -0,0 +1,13 @@
|
|
1
|
+
module SocialHelper
|
2
|
+
def box_class
|
3
|
+
facebook_login_enabled? ? 'small col-sm-8' : 'large col-sm-12'
|
4
|
+
end
|
5
|
+
|
6
|
+
def label_class
|
7
|
+
facebook_login_enabled? ? 'col-sm-12' : 'col-sm-4'
|
8
|
+
end
|
9
|
+
|
10
|
+
def input_class
|
11
|
+
facebook_login_enabled? ? 'col-sm-12' : 'col-sm-8'
|
12
|
+
end
|
13
|
+
end
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title>StormAuth</title>
|
5
|
+
<%= stylesheet_link_tag "//fonts.googleapis.com/css?family=Open+Sans:300italic,300,400italic,400,600italic,600,700italic,700,800italic,800" %>
|
6
|
+
<%= stylesheet_link_tag "//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css" %>
|
7
|
+
<%= stylesheet_link_tag 'application', media: 'all', 'data-turbolinks-track' => true %>
|
8
|
+
<%= stylesheet_link_tag 'stormpath', media: 'all', 'data-turbolinks-track' => true %>
|
9
|
+
<%= javascript_include_tag 'application', 'data-turbolinks-track' => true %>
|
10
|
+
<%= csrf_meta_tags %>
|
11
|
+
</head>
|
12
|
+
<body class="login">
|
13
|
+
|
14
|
+
<% if flash[:notice] %>
|
15
|
+
<div class="alert alert-info"><%= flash[:notice] %></div>
|
16
|
+
<% end %>
|
17
|
+
|
18
|
+
<% if flash[:success] %>
|
19
|
+
<div class="alert alert-success"><%= flash[:success] %></div>
|
20
|
+
<% end %>
|
21
|
+
|
22
|
+
<% if signed_in? %>
|
23
|
+
<p>Logged in as: <%= current_user.given_name %></p>
|
24
|
+
<%= link_to "Log out", sign_out_path, method: :delete %>
|
25
|
+
<% end %>
|
26
|
+
|
27
|
+
<%= yield %>
|
28
|
+
|
29
|
+
<script src="//netdna.bootstrapcdn.com/bootstrap/3.1.1/js/bootstrap.min.js"></script>
|
30
|
+
</body>
|
31
|
+
</html>
|
File without changes
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<div class="container custom-container">
|
2
|
+
<div class="va-wrapper">
|
3
|
+
<div class="view login-view container">
|
4
|
+
<div class="box row">
|
5
|
+
<div class="email-password-area col-xs-12 large col-sm-12">
|
6
|
+
<div class="header">
|
7
|
+
<span>Your password reset email has been sent!</span>
|
8
|
+
<p>We have sent a password reset email to the email address you have provided.</p>
|
9
|
+
<p>Please check your inbox to continue.</p>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
</div>
|
@@ -0,0 +1,33 @@
|
|
1
|
+
<div class="container custom-container">
|
2
|
+
<div class="va-wrapper">
|
3
|
+
<div class="view login-view container">
|
4
|
+
<div class="box row">
|
5
|
+
<div class="email-password-area col-xs-12 large col-sm-12">
|
6
|
+
<div class="header">
|
7
|
+
<span>Forgot your password?</span>
|
8
|
+
<p>Enter your email address below to reset your password. You will be sent an email which you will need to open to continue. You may need to check your spam folder.</p>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<% if flash[:error] %>
|
12
|
+
<div class="alert alert-danger bad-login">
|
13
|
+
<p><%= flash[:error] %></p>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
<%= form_for :password, html: { class: "login-form form-horizontal" }, url: forgot_send_path do |form| %>
|
18
|
+
<div class="form-group group-email">
|
19
|
+
<%= form.label :email, class: "col-sm-4" %>
|
20
|
+
<div class="col-sm-8">
|
21
|
+
<%= form.text_field :email, placeholder: 'Email', class: "form-control" %>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
<div>
|
25
|
+
<%= button_tag "Submit", :class => "login btn btn-login btn-sp-green", :type => "submit" %>
|
26
|
+
</div>
|
27
|
+
<% end %>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
<%= link_to "Back to Log In", sign_in_path, class: "forgot" %>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
</div>
|
@@ -0,0 +1,38 @@
|
|
1
|
+
<div class="container custom-container">
|
2
|
+
<div class="va-wrapper">
|
3
|
+
<div class="view login-view container">
|
4
|
+
<div class="box row">
|
5
|
+
<div class="email-password-area col-xs-12 large col-sm-12">
|
6
|
+
<div class="header">
|
7
|
+
<span>Change Your Password</span>
|
8
|
+
<p>Enter your new account password below. Once confirmed, you'll be logged into your account and your new password will be active.</p>
|
9
|
+
</div>
|
10
|
+
|
11
|
+
<% if flash[:error] %>
|
12
|
+
<div class="alert alert-danger bad-login">
|
13
|
+
<p><%= flash[:error] %></p>
|
14
|
+
</div>
|
15
|
+
<% end %>
|
16
|
+
|
17
|
+
<%= form_for :password, html: { class: "login-form form-horizontal" }, url: forgot_update_path(@account_url) do |form| %>
|
18
|
+
<div class="form-group group-password">
|
19
|
+
<%= form.label :original, class: "col-sm-4" %>
|
20
|
+
<div class="col-sm-8">
|
21
|
+
<%= form.password_field :original, placeholder: 'Password', class: "form-control" %>
|
22
|
+
</div>
|
23
|
+
</div>
|
24
|
+
<div class="form-group group-password">
|
25
|
+
<%= form.label :repeated, 'Password (Again)', class: "col-sm-4" %>
|
26
|
+
<div class="col-sm-8">
|
27
|
+
<%= form.password_field :repeated, placeholder: 'Password (Again)', class: "form-control" %>
|
28
|
+
</div>
|
29
|
+
</div>
|
30
|
+
<div>
|
31
|
+
<%= button_tag "Submit", :class => "login btn btn-login btn-sp-green", :type => "submit" %>
|
32
|
+
</div>
|
33
|
+
<% end %>
|
34
|
+
</div>
|
35
|
+
</div>
|
36
|
+
</div>
|
37
|
+
</div>
|
38
|
+
</div>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<div class="container custom-container">
|
2
|
+
<div class="va-wrapper">
|
3
|
+
<div class="view login-view container">
|
4
|
+
<div class="box row">
|
5
|
+
<div class="email-password-area col-xs-12 large col-sm-12">
|
6
|
+
<div class="header">
|
7
|
+
<span>Password Reset Failed</span>
|
8
|
+
<p>Your password reset attempt has failed. This might happen for several reasons: your reset token might be expired, it might have already been used, or we may just be having issues right now! Please try again, and if you're still having problems, contact the site administrator for help!</p>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
</div>
|
@@ -0,0 +1,19 @@
|
|
1
|
+
<div class="container custom-container">
|
2
|
+
<div class="va-wrapper">
|
3
|
+
<div class="view login-view container">
|
4
|
+
<div class="box row">
|
5
|
+
<div class="email-password-area col-xs-12 large col-sm-12">
|
6
|
+
<div class="header">
|
7
|
+
<span>Password Change Complete!</span>
|
8
|
+
<p>Your password has been changed, and you have been logged into your account. You will be redirected back to the site in 5 seconds.</p>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
|
16
|
+
<script type="text/javascript">
|
17
|
+
var delay = 5000;
|
18
|
+
setTimeout(function(){ window.location = "<%= sign_in_path %>"; }, delay);
|
19
|
+
</script>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<%= button_tag "Facebook", class: "btn btn-social btn-facebook", "onclick" => "facebookLogin()" %>
|
2
|
+
|
3
|
+
<script type="text/javascript">
|
4
|
+
function facebookLogin() {
|
5
|
+
var FB = window.FB;
|
6
|
+
|
7
|
+
FB.login(function(response) {
|
8
|
+
console.log(response);
|
9
|
+
|
10
|
+
if (response.status === 'connected') {
|
11
|
+
window.location.replace("<%= omniauth_login_path %>" + '?access_token=' + response.authResponse.accessToken);
|
12
|
+
}
|
13
|
+
});
|
14
|
+
}
|
15
|
+
|
16
|
+
window.fbAsyncInit = function() {
|
17
|
+
FB.init({
|
18
|
+
appId : <%= facebook_app_id %>,
|
19
|
+
xfbml : true,
|
20
|
+
version : 'v2.4'
|
21
|
+
});
|
22
|
+
};
|
23
|
+
|
24
|
+
(function(d, s, id){
|
25
|
+
var js, fjs = d.getElementsByTagName(s)[0];
|
26
|
+
if (d.getElementById(id)) {return;}
|
27
|
+
js = d.createElement(s); js.id = id;
|
28
|
+
js.src = "//connect.facebook.net/en_US/sdk.js";
|
29
|
+
fjs.parentNode.insertBefore(js, fjs);
|
30
|
+
}(document, 'script', 'facebook-jssdk'));
|
31
|
+
</script>
|
@@ -0,0 +1,31 @@
|
|
1
|
+
<div class="email-password-area col-xs-12 <%= box_class %>">
|
2
|
+
<div class="header">
|
3
|
+
<span>Log in or <%= link_to "Create Account", sign_up_path %></span>
|
4
|
+
</div>
|
5
|
+
|
6
|
+
<% if flash[:error] %>
|
7
|
+
<div class="alert alert-danger bad-login">
|
8
|
+
<p><%= flash[:error] %></p>
|
9
|
+
</div>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<%= form_for :session, url: session_path, html: {class: "login-form form-horizontal"} do |form| %>
|
13
|
+
<div class="form-group group-email">
|
14
|
+
<%= form.label :email, class: label_class %>
|
15
|
+
<div class="<%= input_class %>">
|
16
|
+
<%= form.text_field :email, type: 'text', placeholder: 'Email', class: "form-control", id: "session-email" %>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div class="form-group group-password">
|
21
|
+
<%= form.label :password, class: label_class %>
|
22
|
+
<div class="<%= input_class %>">
|
23
|
+
<%= form.password_field :password, type: 'password', placeholder: 'Password', class: "form-control" %>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<div>
|
28
|
+
<%= button_tag "Log in", :class => "login btn btn-login btn-sp-green", :type => "submit" %>
|
29
|
+
</div>
|
30
|
+
<% end %>
|
31
|
+
</div>
|
@@ -0,0 +1,21 @@
|
|
1
|
+
<div class="container custom-container">
|
2
|
+
<div class="va-wrapper">
|
3
|
+
<div class="view login-view container">
|
4
|
+
<div class="box row">
|
5
|
+
<%= render partial: '/sessions/form' %>
|
6
|
+
<% if social_auth? %>
|
7
|
+
<div class="social-area col-xs-12 col-sm-4">
|
8
|
+
<div class="header">
|
9
|
+
|
10
|
+
</div>
|
11
|
+
<label>Easy 1-click login:</label>
|
12
|
+
<%= render partial: '/sessions/social_auth' %>
|
13
|
+
</div>
|
14
|
+
<% end %>
|
15
|
+
</div>
|
16
|
+
<% if Stormpath::Rails.config.forgot_password.enabled %>
|
17
|
+
<%= link_to "Forgot Password?", forgot_path, class: "forgot" %>
|
18
|
+
<% end %>
|
19
|
+
</div>
|
20
|
+
</div>
|
21
|
+
</div>
|
@@ -0,0 +1,43 @@
|
|
1
|
+
<div class="col-sm-12">
|
2
|
+
<div class="header">
|
3
|
+
<span>Create Account</span>
|
4
|
+
</div>
|
5
|
+
|
6
|
+
<% if flash[:error] %>
|
7
|
+
<div class="alert alert-danger">
|
8
|
+
<p><%= flash[:error] %></p>
|
9
|
+
</div>
|
10
|
+
<% end %>
|
11
|
+
|
12
|
+
<%= form_for @user, html: { class: "registration-form form-horizontal sp-form" } do |form| %>
|
13
|
+
<div form-group="true" class="form-group group-first-name">
|
14
|
+
<%= form.label :given_name, "First Name", class: "col-sm-4" %>
|
15
|
+
<div class="col-sm-8">
|
16
|
+
<%= form.text_field :given_name, placeholder: "First Name", class: "form-control" %>
|
17
|
+
</div>
|
18
|
+
</div>
|
19
|
+
|
20
|
+
<div form-group="true" class="form-group group-first-name">
|
21
|
+
<%= form.label :surname, "Last Name", class: "col-sm-4" %>
|
22
|
+
<div class="col-sm-8">
|
23
|
+
<%= form.text_field :surname, placeholder: "Last Name", class: "form-control" %>
|
24
|
+
</div>
|
25
|
+
</div>
|
26
|
+
|
27
|
+
<div form-group="true" class="form-group group-first-name">
|
28
|
+
<%= form.label :email, "Email", class: "col-sm-4" %>
|
29
|
+
<div class="col-sm-8">
|
30
|
+
<%= form.text_field :email, placeholder: "Email", class: "form-control" %>
|
31
|
+
</div>
|
32
|
+
</div>
|
33
|
+
|
34
|
+
<div form-group="true" class="form-group group-first-name">
|
35
|
+
<%= form.label :password, "Password", class: "col-sm-4" %>
|
36
|
+
<div class="col-sm-8">
|
37
|
+
<%= form.password_field :password, placeholder: "Password", class: "form-control" %>
|
38
|
+
</div>
|
39
|
+
</div>
|
40
|
+
|
41
|
+
<%= button_tag "Create Account", :class => "btn btn-register btn-sp-green", :type => "submit" %>
|
42
|
+
<% end %>
|
43
|
+
</div>
|
@@ -0,0 +1,10 @@
|
|
1
|
+
<div class="container custom-container">
|
2
|
+
<div class="va-wrapper">
|
3
|
+
<div class="view registration-view container">
|
4
|
+
<div class="box row">
|
5
|
+
<%= render partial: '/users/form' %>
|
6
|
+
</div>
|
7
|
+
<%= link_to "Back to Log In", sign_in_path, class: "to-login" %>
|
8
|
+
</div>
|
9
|
+
</div>
|
10
|
+
</div>
|
@@ -0,0 +1,20 @@
|
|
1
|
+
<div class="container custom-container">
|
2
|
+
<div class="va-wrapper">
|
3
|
+
<div class="view login-view container">
|
4
|
+
<div class="box row">
|
5
|
+
<div class="email-password-area col-xs-12 large col-sm-12">
|
6
|
+
<div class="header">
|
7
|
+
<span>Account Verification Complete!</span>
|
8
|
+
<p>Before you can log into your account, you need to activate your account by clicking the link we sent to you at your email address.</p>
|
9
|
+
<p>Your account has been verified, and you have been logged into your account. You will be redirected back to the site in 5 seconds.</p>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
</div>
|
16
|
+
|
17
|
+
<script type="text/javascript">
|
18
|
+
var delay = 5000;
|
19
|
+
setTimeout(function(){ window.location = "<%= root_path %>"; }, delay);
|
20
|
+
</script>
|
@@ -0,0 +1,15 @@
|
|
1
|
+
<div class="container custom-container">
|
2
|
+
<div class="va-wrapper">
|
3
|
+
<div class="view login-view container">
|
4
|
+
<div class="box row">
|
5
|
+
<div class="email-password-area col-xs-12 large col-sm-12">
|
6
|
+
<div class="header">
|
7
|
+
<span>Your account verification email has been sent!</span>
|
8
|
+
<p>Before you can log into your account, you need to activate your account by clicking the link we sent to you at your email address.</p>
|
9
|
+
<p>Please check your inbox to continue.</p>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
</div>
|
15
|
+
</div>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<div class="container custom-container">
|
2
|
+
<div class="va-wrapper">
|
3
|
+
<div class="view login-view container">
|
4
|
+
<div class="box row">
|
5
|
+
<div class="email-password-area col-xs-12 large col-sm-12">
|
6
|
+
<div class="header">
|
7
|
+
<span>Verification Failed</span>
|
8
|
+
<p>Your account verification has failed. This might happen for several reasons: your verification token might be expired, it might have already been used, or we may just be having issues right now! Please try again, and if you're still having problems, contact the site administrator for help!</p>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
</div>
|
@@ -0,0 +1,14 @@
|
|
1
|
+
<div class="container custom-container">
|
2
|
+
<div class="va-wrapper">
|
3
|
+
<div class="view login-view container">
|
4
|
+
<div class="box row">
|
5
|
+
<div class="email-password-area col-xs-12 large col-sm-12">
|
6
|
+
<div class="header">
|
7
|
+
<span>Didn't receive your account verification email?</span>
|
8
|
+
<p>Enter your email address below and we'll resend your account verification email. You will be sent an email which you will need to open to continue. You may need to check your spam folder.</p>
|
9
|
+
</div>
|
10
|
+
</div>
|
11
|
+
</div>
|
12
|
+
</div>
|
13
|
+
</div>
|
14
|
+
</div>
|
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "stormpath/rails"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/rails
ADDED
@@ -0,0 +1,12 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
# This command will automatically be run when you run "rails" with Rails 4 gems installed from the root of your application.
|
3
|
+
|
4
|
+
ENGINE_ROOT = File.expand_path('../..', __FILE__)
|
5
|
+
ENGINE_PATH = File.expand_path('../../lib/stormpath/rails/engine', __FILE__)
|
6
|
+
|
7
|
+
# Set up gems listed in the Gemfile.
|
8
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
|
9
|
+
require 'bundler/setup' if File.exist?(ENV['BUNDLE_GEMFILE'])
|
10
|
+
|
11
|
+
require 'rails/all'
|
12
|
+
require 'rails/engine/commands'
|
data/bin/rake
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'rake' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('rake', 'rake')
|
data/bin/rspec
ADDED
@@ -0,0 +1,16 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
#
|
3
|
+
# This file was generated by Bundler.
|
4
|
+
#
|
5
|
+
# The application 'rspec' is installed as part of a gem, and
|
6
|
+
# this file is here to facilitate running it.
|
7
|
+
#
|
8
|
+
|
9
|
+
require 'pathname'
|
10
|
+
ENV['BUNDLE_GEMFILE'] ||= File.expand_path("../../Gemfile",
|
11
|
+
Pathname.new(__FILE__).realpath)
|
12
|
+
|
13
|
+
require 'rubygems'
|
14
|
+
require 'bundler/setup'
|
15
|
+
|
16
|
+
load Gem.bin_path('rspec-core', 'rspec')
|