cbsorcery 0.8.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.document +5 -0
- data/.gitignore +56 -0
- data/.rspec +1 -0
- data/.travis.yml +40 -0
- data/CHANGELOG.md +263 -0
- data/Gemfile +6 -0
- data/LICENSE.txt +20 -0
- data/README.md +360 -0
- data/Rakefile +6 -0
- data/gemfiles/active_record-rails40.gemfile +7 -0
- data/gemfiles/active_record-rails41.gemfile +7 -0
- data/lib/generators/sorcery/USAGE +22 -0
- data/lib/generators/sorcery/helpers.rb +40 -0
- data/lib/generators/sorcery/install_generator.rb +95 -0
- data/lib/generators/sorcery/templates/initializer.rb +451 -0
- data/lib/generators/sorcery/templates/migration/activity_logging.rb +10 -0
- data/lib/generators/sorcery/templates/migration/brute_force_protection.rb +9 -0
- data/lib/generators/sorcery/templates/migration/core.rb +13 -0
- data/lib/generators/sorcery/templates/migration/external.rb +12 -0
- data/lib/generators/sorcery/templates/migration/remember_me.rb +8 -0
- data/lib/generators/sorcery/templates/migration/reset_password.rb +9 -0
- data/lib/generators/sorcery/templates/migration/user_activation.rb +9 -0
- data/lib/sorcery.rb +85 -0
- data/lib/sorcery/adapters/active_record_adapter.rb +120 -0
- data/lib/sorcery/adapters/base_adapter.rb +30 -0
- data/lib/sorcery/controller.rb +157 -0
- data/lib/sorcery/controller/config.rb +65 -0
- data/lib/sorcery/controller/submodules/activity_logging.rb +82 -0
- data/lib/sorcery/controller/submodules/brute_force_protection.rb +38 -0
- data/lib/sorcery/controller/submodules/external.rb +199 -0
- data/lib/sorcery/controller/submodules/http_basic_auth.rb +74 -0
- data/lib/sorcery/controller/submodules/remember_me.rb +81 -0
- data/lib/sorcery/controller/submodules/session_timeout.rb +56 -0
- data/lib/sorcery/crypto_providers/aes256.rb +51 -0
- data/lib/sorcery/crypto_providers/bcrypt.rb +97 -0
- data/lib/sorcery/crypto_providers/common.rb +35 -0
- data/lib/sorcery/crypto_providers/md5.rb +19 -0
- data/lib/sorcery/crypto_providers/sha1.rb +28 -0
- data/lib/sorcery/crypto_providers/sha256.rb +36 -0
- data/lib/sorcery/crypto_providers/sha512.rb +36 -0
- data/lib/sorcery/engine.rb +21 -0
- data/lib/sorcery/model.rb +183 -0
- data/lib/sorcery/model/config.rb +96 -0
- data/lib/sorcery/model/submodules/activity_logging.rb +70 -0
- data/lib/sorcery/model/submodules/brute_force_protection.rb +125 -0
- data/lib/sorcery/model/submodules/external.rb +100 -0
- data/lib/sorcery/model/submodules/remember_me.rb +62 -0
- data/lib/sorcery/model/submodules/reset_password.rb +131 -0
- data/lib/sorcery/model/submodules/user_activation.rb +149 -0
- data/lib/sorcery/model/temporary_token.rb +30 -0
- data/lib/sorcery/protocols/certs/ca-bundle.crt +5182 -0
- data/lib/sorcery/protocols/oauth.rb +42 -0
- data/lib/sorcery/protocols/oauth2.rb +47 -0
- data/lib/sorcery/providers/base.rb +27 -0
- data/lib/sorcery/providers/facebook.rb +63 -0
- data/lib/sorcery/providers/github.rb +51 -0
- data/lib/sorcery/providers/google.rb +51 -0
- data/lib/sorcery/providers/jira.rb +77 -0
- data/lib/sorcery/providers/linkedin.rb +66 -0
- data/lib/sorcery/providers/liveid.rb +53 -0
- data/lib/sorcery/providers/twitter.rb +59 -0
- data/lib/sorcery/providers/vk.rb +63 -0
- data/lib/sorcery/providers/xing.rb +64 -0
- data/lib/sorcery/railties/tasks.rake +6 -0
- data/lib/sorcery/test_helpers/internal.rb +78 -0
- data/lib/sorcery/test_helpers/internal/rails.rb +68 -0
- data/lib/sorcery/test_helpers/rails/controller.rb +21 -0
- data/lib/sorcery/test_helpers/rails/integration.rb +26 -0
- data/lib/sorcery/version.rb +3 -0
- data/sorcery.gemspec +34 -0
- data/spec/active_record/user_activation_spec.rb +18 -0
- data/spec/active_record/user_activity_logging_spec.rb +17 -0
- data/spec/active_record/user_brute_force_protection_spec.rb +16 -0
- data/spec/active_record/user_oauth_spec.rb +16 -0
- data/spec/active_record/user_remember_me_spec.rb +16 -0
- data/spec/active_record/user_reset_password_spec.rb +16 -0
- data/spec/active_record/user_spec.rb +37 -0
- data/spec/controllers/controller_activity_logging_spec.rb +124 -0
- data/spec/controllers/controller_brute_force_protection_spec.rb +43 -0
- data/spec/controllers/controller_http_basic_auth_spec.rb +68 -0
- data/spec/controllers/controller_oauth2_spec.rb +407 -0
- data/spec/controllers/controller_oauth_spec.rb +240 -0
- data/spec/controllers/controller_remember_me_spec.rb +117 -0
- data/spec/controllers/controller_session_timeout_spec.rb +80 -0
- data/spec/controllers/controller_spec.rb +215 -0
- data/spec/orm/active_record.rb +21 -0
- data/spec/rails_app/app/active_record/authentication.rb +3 -0
- data/spec/rails_app/app/active_record/user.rb +5 -0
- data/spec/rails_app/app/active_record/user_provider.rb +3 -0
- data/spec/rails_app/app/controllers/sorcery_controller.rb +265 -0
- data/spec/rails_app/app/helpers/application_helper.rb +2 -0
- data/spec/rails_app/app/mailers/sorcery_mailer.rb +32 -0
- data/spec/rails_app/app/views/application/index.html.erb +17 -0
- data/spec/rails_app/app/views/layouts/application.html.erb +14 -0
- data/spec/rails_app/app/views/sorcery_mailer/activation_email.html.erb +17 -0
- data/spec/rails_app/app/views/sorcery_mailer/activation_email.text.erb +9 -0
- data/spec/rails_app/app/views/sorcery_mailer/activation_needed_email.html.erb +17 -0
- data/spec/rails_app/app/views/sorcery_mailer/activation_success_email.html.erb +17 -0
- data/spec/rails_app/app/views/sorcery_mailer/activation_success_email.text.erb +9 -0
- data/spec/rails_app/app/views/sorcery_mailer/reset_password_email.html.erb +16 -0
- data/spec/rails_app/app/views/sorcery_mailer/reset_password_email.text.erb +8 -0
- data/spec/rails_app/app/views/sorcery_mailer/send_unlock_token_email.text.erb +1 -0
- data/spec/rails_app/config.ru +4 -0
- data/spec/rails_app/config/application.rb +56 -0
- data/spec/rails_app/config/boot.rb +4 -0
- data/spec/rails_app/config/database.yml +22 -0
- data/spec/rails_app/config/environment.rb +5 -0
- data/spec/rails_app/config/environments/test.rb +37 -0
- data/spec/rails_app/config/initializers/backtrace_silencers.rb +7 -0
- data/spec/rails_app/config/initializers/inflections.rb +10 -0
- data/spec/rails_app/config/initializers/mime_types.rb +5 -0
- data/spec/rails_app/config/initializers/secret_token.rb +7 -0
- data/spec/rails_app/config/initializers/session_store.rb +12 -0
- data/spec/rails_app/config/locales/en.yml +5 -0
- data/spec/rails_app/config/routes.rb +48 -0
- data/spec/rails_app/db/migrate/activation/20101224223622_add_activation_to_users.rb +17 -0
- data/spec/rails_app/db/migrate/activity_logging/20101224223624_add_activity_logging_to_users.rb +19 -0
- data/spec/rails_app/db/migrate/brute_force_protection/20101224223626_add_brute_force_protection_to_users.rb +13 -0
- data/spec/rails_app/db/migrate/core/20101224223620_create_users.rb +16 -0
- data/spec/rails_app/db/migrate/external/20101224223628_create_authentications_and_user_providers.rb +22 -0
- data/spec/rails_app/db/migrate/remember_me/20101224223623_add_remember_me_token_to_users.rb +15 -0
- data/spec/rails_app/db/migrate/reset_password/20101224223622_add_reset_password_to_users.rb +13 -0
- data/spec/rails_app/db/schema.rb +23 -0
- data/spec/rails_app/db/seeds.rb +7 -0
- data/spec/shared_examples/user_activation_shared_examples.rb +242 -0
- data/spec/shared_examples/user_activity_logging_shared_examples.rb +97 -0
- data/spec/shared_examples/user_brute_force_protection_shared_examples.rb +156 -0
- data/spec/shared_examples/user_oauth_shared_examples.rb +36 -0
- data/spec/shared_examples/user_remember_me_shared_examples.rb +57 -0
- data/spec/shared_examples/user_reset_password_shared_examples.rb +263 -0
- data/spec/shared_examples/user_shared_examples.rb +467 -0
- data/spec/sorcery_crypto_providers_spec.rb +198 -0
- data/spec/spec.opts +2 -0
- data/spec/spec_helper.rb +41 -0
- metadata +350 -0
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
require 'sorcery'
|
|
2
|
+
|
|
3
|
+
ActiveRecord::Migration.verbose = false
|
|
4
|
+
# ActiveRecord::Base.logger = Logger.new(nil)
|
|
5
|
+
# ActiveRecord::Base.include_root_in_json = true
|
|
6
|
+
|
|
7
|
+
class TestUser < ActiveRecord::Base
|
|
8
|
+
authenticates_with_sorcery!
|
|
9
|
+
end
|
|
10
|
+
|
|
11
|
+
def setup_orm
|
|
12
|
+
ActiveRecord::Migrator.migrate(migrations_path)
|
|
13
|
+
end
|
|
14
|
+
|
|
15
|
+
def teardown_orm
|
|
16
|
+
ActiveRecord::Migrator.rollback(migrations_path)
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def migrations_path
|
|
20
|
+
Rails.root.join("db", "migrate", "core")
|
|
21
|
+
end
|
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
require 'oauth'
|
|
2
|
+
|
|
3
|
+
class SorceryController < ActionController::Base
|
|
4
|
+
protect_from_forgery
|
|
5
|
+
|
|
6
|
+
before_filter :require_login_from_http_basic, only: [:test_http_basic_auth]
|
|
7
|
+
before_filter :require_login, only: [:test_logout, :test_should_be_logged_in, :some_action]
|
|
8
|
+
|
|
9
|
+
def index
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def some_action
|
|
13
|
+
render nothing: true
|
|
14
|
+
end
|
|
15
|
+
|
|
16
|
+
def some_action_making_a_non_persisted_change_to_the_user
|
|
17
|
+
current_user.email = 'to_be_ignored'
|
|
18
|
+
render nothing: true
|
|
19
|
+
end
|
|
20
|
+
|
|
21
|
+
def test_login
|
|
22
|
+
@user = login(params[:email], params[:password])
|
|
23
|
+
render nothing: true
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def test_auto_login
|
|
27
|
+
@user = User.first
|
|
28
|
+
auto_login(@user)
|
|
29
|
+
@result = current_user
|
|
30
|
+
render nothing: true
|
|
31
|
+
end
|
|
32
|
+
|
|
33
|
+
def test_return_to
|
|
34
|
+
@user = login(params[:email], params[:password])
|
|
35
|
+
redirect_back_or_to(:index, notice: 'haha!')
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
def test_logout
|
|
39
|
+
logout
|
|
40
|
+
render nothing: true
|
|
41
|
+
end
|
|
42
|
+
|
|
43
|
+
def test_logout_with_remember
|
|
44
|
+
remember_me!
|
|
45
|
+
logout
|
|
46
|
+
render nothing: true
|
|
47
|
+
end
|
|
48
|
+
|
|
49
|
+
def test_login_with_remember
|
|
50
|
+
@user = login(params[:email], params[:password])
|
|
51
|
+
remember_me!
|
|
52
|
+
|
|
53
|
+
render nothing: true
|
|
54
|
+
end
|
|
55
|
+
|
|
56
|
+
def test_login_with_remember_in_login
|
|
57
|
+
@user = login(params[:email], params[:password], params[:remember])
|
|
58
|
+
|
|
59
|
+
render nothing: true
|
|
60
|
+
end
|
|
61
|
+
|
|
62
|
+
def test_login_from_cookie
|
|
63
|
+
@user = current_user
|
|
64
|
+
render nothing: true
|
|
65
|
+
end
|
|
66
|
+
|
|
67
|
+
def test_not_authenticated_action
|
|
68
|
+
render text: 'test_not_authenticated_action'
|
|
69
|
+
end
|
|
70
|
+
|
|
71
|
+
def test_should_be_logged_in
|
|
72
|
+
render nothing: true
|
|
73
|
+
end
|
|
74
|
+
|
|
75
|
+
def test_http_basic_auth
|
|
76
|
+
render text: 'HTTP Basic Auth'
|
|
77
|
+
end
|
|
78
|
+
|
|
79
|
+
def login_at_test_twitter
|
|
80
|
+
login_at(:twitter)
|
|
81
|
+
end
|
|
82
|
+
|
|
83
|
+
alias :login_at_test :login_at_test_twitter
|
|
84
|
+
|
|
85
|
+
def login_at_test_facebook
|
|
86
|
+
login_at(:facebook)
|
|
87
|
+
end
|
|
88
|
+
|
|
89
|
+
def login_at_test_github
|
|
90
|
+
login_at(:github)
|
|
91
|
+
end
|
|
92
|
+
|
|
93
|
+
def login_at_test_google
|
|
94
|
+
login_at(:google)
|
|
95
|
+
end
|
|
96
|
+
|
|
97
|
+
def login_at_test_liveid
|
|
98
|
+
login_at(:liveid)
|
|
99
|
+
end
|
|
100
|
+
|
|
101
|
+
def login_at_test_jira
|
|
102
|
+
login_at(:jira)
|
|
103
|
+
end
|
|
104
|
+
|
|
105
|
+
def login_at_test_vk
|
|
106
|
+
login_at(:vk)
|
|
107
|
+
end
|
|
108
|
+
|
|
109
|
+
def login_at_test_with_state
|
|
110
|
+
login_at(:facebook, {state: 'bla'})
|
|
111
|
+
end
|
|
112
|
+
|
|
113
|
+
def test_login_from_twitter
|
|
114
|
+
if @user = login_from(:twitter)
|
|
115
|
+
redirect_to 'bla', notice: 'Success!'
|
|
116
|
+
else
|
|
117
|
+
redirect_to 'blu', alert: 'Failed!'
|
|
118
|
+
end
|
|
119
|
+
end
|
|
120
|
+
|
|
121
|
+
alias :test_login_from :test_login_from_twitter
|
|
122
|
+
|
|
123
|
+
def test_login_from_facebook
|
|
124
|
+
if @user = login_from(:facebook)
|
|
125
|
+
redirect_to 'bla', notice: 'Success!'
|
|
126
|
+
else
|
|
127
|
+
redirect_to 'blu', alert: 'Failed!'
|
|
128
|
+
end
|
|
129
|
+
end
|
|
130
|
+
|
|
131
|
+
def test_login_from_github
|
|
132
|
+
if @user = login_from(:github)
|
|
133
|
+
redirect_to 'bla', notice: 'Success!'
|
|
134
|
+
else
|
|
135
|
+
redirect_to 'blu', alert: 'Failed!'
|
|
136
|
+
end
|
|
137
|
+
end
|
|
138
|
+
|
|
139
|
+
def test_login_from_google
|
|
140
|
+
if @user = login_from(:google)
|
|
141
|
+
redirect_to 'bla', notice: 'Success!'
|
|
142
|
+
else
|
|
143
|
+
redirect_to 'blu', alert: 'Failed!'
|
|
144
|
+
end
|
|
145
|
+
end
|
|
146
|
+
|
|
147
|
+
def test_login_from_liveid
|
|
148
|
+
if @user = login_from(:liveid)
|
|
149
|
+
redirect_to 'bla', notice: 'Success!'
|
|
150
|
+
else
|
|
151
|
+
redirect_to 'blu', alert: 'Failed!'
|
|
152
|
+
end
|
|
153
|
+
end
|
|
154
|
+
|
|
155
|
+
def test_login_from_vk
|
|
156
|
+
if @user = login_from(:vk)
|
|
157
|
+
redirect_to 'bla', notice: 'Success!'
|
|
158
|
+
else
|
|
159
|
+
redirect_to 'blu', alert: 'Failed!'
|
|
160
|
+
end
|
|
161
|
+
end
|
|
162
|
+
|
|
163
|
+
def test_login_from_jira
|
|
164
|
+
if @user = login_from(:jira)
|
|
165
|
+
redirect_to 'bla', notice: 'Success!'
|
|
166
|
+
else
|
|
167
|
+
redirect_to 'blu', alert: 'Failed!'
|
|
168
|
+
end
|
|
169
|
+
end
|
|
170
|
+
|
|
171
|
+
def test_return_to_with_external_twitter
|
|
172
|
+
if @user = login_from(:twitter)
|
|
173
|
+
redirect_back_or_to 'bla', notice: 'Success!'
|
|
174
|
+
else
|
|
175
|
+
redirect_to 'blu', alert: 'Failed!'
|
|
176
|
+
end
|
|
177
|
+
end
|
|
178
|
+
|
|
179
|
+
def test_return_to_with_external_jira
|
|
180
|
+
if @user = login_from(:jira)
|
|
181
|
+
redirect_back_or_to 'bla', notice: 'Success!'
|
|
182
|
+
else
|
|
183
|
+
redirect_to 'blu', alert: 'Failed!'
|
|
184
|
+
end
|
|
185
|
+
end
|
|
186
|
+
|
|
187
|
+
alias :test_return_to_with_external :test_return_to_with_external_twitter
|
|
188
|
+
|
|
189
|
+
def test_return_to_with_external_facebook
|
|
190
|
+
if @user = login_from(:facebook)
|
|
191
|
+
redirect_back_or_to 'bla', notice: 'Success!'
|
|
192
|
+
else
|
|
193
|
+
redirect_to 'blu', alert: 'Failed!'
|
|
194
|
+
end
|
|
195
|
+
end
|
|
196
|
+
|
|
197
|
+
def test_return_to_with_external_github
|
|
198
|
+
if @user = login_from(:github)
|
|
199
|
+
redirect_back_or_to 'bla', notice: 'Success!'
|
|
200
|
+
else
|
|
201
|
+
redirect_to 'blu', alert: 'Failed!'
|
|
202
|
+
end
|
|
203
|
+
end
|
|
204
|
+
|
|
205
|
+
def test_return_to_with_external_google
|
|
206
|
+
if @user = login_from(:google)
|
|
207
|
+
redirect_back_or_to 'bla', notice: 'Success!'
|
|
208
|
+
else
|
|
209
|
+
redirect_to 'blu', alert: 'Failed!'
|
|
210
|
+
end
|
|
211
|
+
end
|
|
212
|
+
|
|
213
|
+
def test_return_to_with_external_liveid
|
|
214
|
+
if @user = login_from(:liveid)
|
|
215
|
+
redirect_back_or_to 'bla', notice: 'Success!'
|
|
216
|
+
else
|
|
217
|
+
redirect_to 'blu', alert: 'Failed!'
|
|
218
|
+
end
|
|
219
|
+
end
|
|
220
|
+
|
|
221
|
+
def test_return_to_with_external_vk
|
|
222
|
+
if @user = login_from(:vk)
|
|
223
|
+
redirect_back_or_to 'bla', notice: 'Success!'
|
|
224
|
+
else
|
|
225
|
+
redirect_to 'blu', alert: 'Failed!'
|
|
226
|
+
end
|
|
227
|
+
end
|
|
228
|
+
|
|
229
|
+
def test_create_from_provider
|
|
230
|
+
provider = params[:provider]
|
|
231
|
+
login_from(provider)
|
|
232
|
+
if @user = create_from(provider)
|
|
233
|
+
redirect_to 'bla', notice: 'Success!'
|
|
234
|
+
else
|
|
235
|
+
redirect_to 'blu', alert: 'Failed!'
|
|
236
|
+
end
|
|
237
|
+
end
|
|
238
|
+
|
|
239
|
+
def test_add_second_provider
|
|
240
|
+
provider = params[:provider]
|
|
241
|
+
if logged_in?
|
|
242
|
+
if @user = add_provider_to_user(provider)
|
|
243
|
+
redirect_to "bla", :notice => "Success!"
|
|
244
|
+
else
|
|
245
|
+
redirect_to "blu", :alert => "Failed!"
|
|
246
|
+
end
|
|
247
|
+
end
|
|
248
|
+
end
|
|
249
|
+
|
|
250
|
+
def test_create_from_provider_with_block
|
|
251
|
+
provider = params[:provider]
|
|
252
|
+
login_from(provider)
|
|
253
|
+
@user = create_from(provider) do |user|
|
|
254
|
+
# check uniqueness of email
|
|
255
|
+
# User.where(email: user.email).empty?
|
|
256
|
+
false
|
|
257
|
+
end
|
|
258
|
+
if @user
|
|
259
|
+
redirect_to 'bla', notice: 'Success!'
|
|
260
|
+
else
|
|
261
|
+
redirect_to 'blu', alert: 'Failed!'
|
|
262
|
+
end
|
|
263
|
+
end
|
|
264
|
+
|
|
265
|
+
end
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
class SorceryMailer < ActionMailer::Base
|
|
2
|
+
|
|
3
|
+
default :from => "notifications@example.com"
|
|
4
|
+
|
|
5
|
+
def activation_needed_email(user)
|
|
6
|
+
@user = user
|
|
7
|
+
@url = "http://example.com/login"
|
|
8
|
+
mail(:to => user.email,
|
|
9
|
+
:subject => "Welcome to My Awesome Site")
|
|
10
|
+
end
|
|
11
|
+
|
|
12
|
+
def activation_success_email(user)
|
|
13
|
+
@user = user
|
|
14
|
+
@url = "http://example.com/login"
|
|
15
|
+
mail(:to => user.email,
|
|
16
|
+
:subject => "Your account is now activated")
|
|
17
|
+
end
|
|
18
|
+
|
|
19
|
+
def reset_password_email(user)
|
|
20
|
+
@user = user
|
|
21
|
+
@url = "http://example.com/login"
|
|
22
|
+
mail(:to => user.email,
|
|
23
|
+
:subject => "Your password has been reset")
|
|
24
|
+
end
|
|
25
|
+
|
|
26
|
+
def send_unlock_token_email(user)
|
|
27
|
+
@user = user
|
|
28
|
+
@url = "http://example.com/unlock/#{user.unlock_token}"
|
|
29
|
+
mail(:to => user.email,
|
|
30
|
+
:subject => "Your account has been locked due to many wrong logins")
|
|
31
|
+
end
|
|
32
|
+
end
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<%= form_tag :action => :test_login, :method => :post do %>
|
|
2
|
+
<div class="field">
|
|
3
|
+
<%= label_tag :username %><br />
|
|
4
|
+
<%= text_field_tag :username %>
|
|
5
|
+
</div>
|
|
6
|
+
<div class="field">
|
|
7
|
+
<%= label_tag :password %><br />
|
|
8
|
+
<%= password_field_tag :password %>
|
|
9
|
+
</div>
|
|
10
|
+
<div class="actions">
|
|
11
|
+
<%= submit_tag "Login" %>
|
|
12
|
+
</div>
|
|
13
|
+
<div>
|
|
14
|
+
<%= label_tag "keep me logged in" %><br />
|
|
15
|
+
<%= check_box_tag :remember %>
|
|
16
|
+
</div>
|
|
17
|
+
<% end %>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
|
5
|
+
</head>
|
|
6
|
+
<body>
|
|
7
|
+
<h1>Welcome to example.com, <%= @user.username %></h1>
|
|
8
|
+
<p>
|
|
9
|
+
You have successfully signed up to example.com,
|
|
10
|
+
your username is: <%= @user.username %>.<br/>
|
|
11
|
+
</p>
|
|
12
|
+
<p>
|
|
13
|
+
To login to the site, just follow this link: <%= @url %>.
|
|
14
|
+
</p>
|
|
15
|
+
<p>Thanks for joining and have a great day!</p>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Welcome to example.com, <%= @user.username %>
|
|
2
|
+
===============================================
|
|
3
|
+
|
|
4
|
+
You have successfully signed up to example.com,
|
|
5
|
+
your username is: <%= @user.username %>.
|
|
6
|
+
|
|
7
|
+
To login to the site, just follow this link: <%= @url %>.
|
|
8
|
+
|
|
9
|
+
Thanks for joining and have a great day!
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
|
5
|
+
</head>
|
|
6
|
+
<body>
|
|
7
|
+
<h1>Congratz, <%= @user.username %></h1>
|
|
8
|
+
<p>
|
|
9
|
+
You have successfully activated your example.com account,
|
|
10
|
+
your username is: <%= @user.username %>.<br/>
|
|
11
|
+
</p>
|
|
12
|
+
<p>
|
|
13
|
+
To login to the site, just follow this link: <%= @url %>.
|
|
14
|
+
</p>
|
|
15
|
+
<p>Thanks for joining and have a great day!</p>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
<!DOCTYPE html>
|
|
2
|
+
<html>
|
|
3
|
+
<head>
|
|
4
|
+
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type" />
|
|
5
|
+
</head>
|
|
6
|
+
<body>
|
|
7
|
+
<h1>Congratz, <%= @user.username %></h1>
|
|
8
|
+
<p>
|
|
9
|
+
You have successfully activated your example.com account,
|
|
10
|
+
your username is: <%= @user.username %>.<br/>
|
|
11
|
+
</p>
|
|
12
|
+
<p>
|
|
13
|
+
To login to the site, just follow this link: <%= @url %>.
|
|
14
|
+
</p>
|
|
15
|
+
<p>Thanks for joining and have a great day!</p>
|
|
16
|
+
</body>
|
|
17
|
+
</html>
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
Congratz, <%= @user.username %>
|
|
2
|
+
===============================================
|
|
3
|
+
|
|
4
|
+
You have successfully activated your example.com account,
|
|
5
|
+
your username is: <%= @user.username %>.
|
|
6
|
+
|
|
7
|
+
To login to the site, just follow this link: <%= @url %>.
|
|
8
|
+
|
|
9
|
+
Thanks for joining and have a great day!
|