credible 0.4.0 → 0.5.0

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 534ceaffb085783354fb29b8e30cd25fc4bca42282b7c729798cda1e35eb4809
4
- data.tar.gz: 7a30018164a97fef54c90deb80e92f607039cf1c9604ca740872859c9554bc89
3
+ metadata.gz: d4c5ed3ddcad0d273dd3637387e2dbc0707cdb0d6f798220ff7dbe5837771e47
4
+ data.tar.gz: a130e2ef99889ed2811fdea510f939771e8472f31beb5aafb5908db517ce73a3
5
5
  SHA512:
6
- metadata.gz: 1ef0e645f4f52194c7244ae550ca50c17e073e27b6c420b3a8f57ab92e284be098959f6af2fa926a05530c351d7c59206bbcfb5f9825c6f9212a4fe7f7fe128a
7
- data.tar.gz: 7f7f48f126f381505c8c73c1122a249f47421d2feef5a84a726de35a8bb09a1f7e0650a64bcdcbcc7009d0895e4b7e04ec912838d4e0fb49f0b1f0cb6d257ca9
6
+ metadata.gz: aee55582756b905e423934dacc61fbe8871debd89b0605ac0acfdd0a71929326a4dbdd9afc3fd939cdd59a05c997fd6897f8b1be1ca529f5628b60762f06e7a5
7
+ data.tar.gz: dd2897f009bec2bb23dc41308ca0808f62138064d1f1b8ec866801ee303c93a3d2e66dc6607dc8ade859f0714be380a2a7ca23f3aa4dd4ab8372a7332736c940
@@ -21,7 +21,7 @@ class Credible::Authentication::UsersController < Credible::AuthenticationContro
21
21
  authorize @user
22
22
 
23
23
  if @user.save
24
- Credible::UserMailer.with(user: @user).confirmation_email.deliver_later
24
+ Credible::ConfirmationMailer.with(user: @user).confirmation_email.deliver_later
25
25
  @session = ::Session.create(user: @user)
26
26
  render :show, status: :created, location: @user
27
27
  else
@@ -54,7 +54,7 @@ class Credible::Authentication::UsersController < Credible::AuthenticationContro
54
54
  @user.reset_password
55
55
 
56
56
  if @user.save
57
- Credible::UserMailer.with(user: @user).confirmation_email.deliver_later
57
+ Credible::ResetPasswordMailer.with(user: @user).reset_password_email.deliver_later
58
58
  render :show, status: :ok, location: @user
59
59
  else
60
60
  render json: @user.errors, status: :unprocessable_entity
@@ -1,6 +1,4 @@
1
- class Credible::UserMailer < ApplicationMailer
2
- include Rails.application.routes.url_helpers
3
-
1
+ class Credible::ConfirmationMailer < CredibleMailer
4
2
  def confirmation_email
5
3
  @app_name = Rails.application.class.module_parent_name
6
4
  @user = params[:user]
@@ -8,11 +6,4 @@ class Credible::UserMailer < ApplicationMailer
8
6
  @confirmation_url = @url + 'confirm/' + @user.confirmation_token + '?email=' + @user.email
9
7
  mail(to: @user.email, subject: "Welcome to #{@app_name} | Please confirm your account")
10
8
  end
11
-
12
- def invitation_email
13
- @app_name = Rails.application.class.module_parent_name
14
- @user = params[:user]
15
- @url = root_url
16
- mail(to: @user.email, subject: "You have been invited to #{@app_name}")
17
- end
18
9
  end
@@ -0,0 +1,9 @@
1
+ class Credible::InvitationMailer < CredibleMailer
2
+ def invitation_email
3
+ @app_name = Rails.application.class.module_parent_name
4
+ @user = params[:user]
5
+ @url = root_url
6
+ @invitation_url = @url + 'confirm/' + @user.confirmation_token + '?email=' + @user.email
7
+ mail(to: @user.email, subject: "You have been invited to #{@app_name}")
8
+ end
9
+ end
@@ -0,0 +1,9 @@
1
+ class Credible::ResetPasswordMailer < CredibleMailer
2
+ def reset_password_email
3
+ @app_name = Rails.application.class.module_parent_name
4
+ @user = params[:user]
5
+ @url = root_url
6
+ @reset_password_url = @url + 'confirm/' + @user.confirmation_token + '?email=' + @user.email
7
+ mail(to: @user.email, subject: "Please reset your #{@app_name} password")
8
+ end
9
+ end
@@ -0,0 +1,3 @@
1
+ class CredibleMailer < ApplicationMailer
2
+ include Rails.application.routes.url_helpers
3
+ end
@@ -0,0 +1,7 @@
1
+ %h1= "You have been invited to #{@app_name}"
2
+
3
+ %p
4
+ To confirm your account, please follow this link:
5
+ = link_to @invitation_url, @invitation_url
6
+
7
+ %p We look forward to having you!
@@ -0,0 +1,6 @@
1
+ = "You have been invited to #{@app_name}"
2
+
3
+ To confirm your account, please follow this link:
4
+ = link_to @invitation_url, @invitation_url
5
+
6
+ We look forward to having you!
@@ -0,0 +1,7 @@
1
+ %h1 You have requested a password reset
2
+
3
+ %p
4
+ To sign in and reset your password, please follow this link:
5
+ = link_to @reset_password_url, @reset_password_url
6
+
7
+ %p It's good to have you back!
@@ -0,0 +1,6 @@
1
+ You have requested a password reset
2
+
3
+ To sign in and reset your password, please follow this link:
4
+ = link_to @reset_password_url, @reset_password_url
5
+
6
+ It's good to have you back!
@@ -1,3 +1,3 @@
1
1
  module Credible
2
- VERSION = '0.4.0'
2
+ VERSION = '0.5.0'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: credible
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thom Bruce
@@ -100,7 +100,10 @@ files:
100
100
  - app/controllers/credible/authentication_controller.rb
101
101
  - app/helpers/credible/application_helper.rb
102
102
  - app/jobs/credible/application_job.rb
103
- - app/mailers/credible/user_mailer.rb
103
+ - app/mailers/credible/confirmation_mailer.rb
104
+ - app/mailers/credible/invitation_mailer.rb
105
+ - app/mailers/credible/reset_password_mailer.rb
106
+ - app/mailers/credible_mailer.rb
104
107
  - app/models/credible/application_record.rb
105
108
  - app/policies/credible/application_policy.rb
106
109
  - app/policies/credible/authentication/session_policy.rb
@@ -110,10 +113,12 @@ files:
110
113
  - app/views/credible/authentication/sessions/show.json.jbuilder
111
114
  - app/views/credible/authentication/users/_user.json.jbuilder
112
115
  - app/views/credible/authentication/users/show.json.jbuilder
113
- - app/views/credible/user_mailer/confirmation_email.html.haml
114
- - app/views/credible/user_mailer/confirmation_email.text.haml
115
- - app/views/credible/user_mailer/invitation_email.html.haml
116
- - app/views/credible/user_mailer/invitation_email.text.haml
116
+ - app/views/credible/confirmation_mailer/confirmation_email.html.haml
117
+ - app/views/credible/confirmation_mailer/confirmation_email.text.haml
118
+ - app/views/credible/invitation_mailer/invitation_email.html.haml
119
+ - app/views/credible/invitation_mailer/invitation_email.text.haml
120
+ - app/views/credible/reset_password_mailer/reset_password_email.html.haml
121
+ - app/views/credible/reset_password_mailer/reset_password_email.text.haml
117
122
  - config/initializers/warden.rb
118
123
  - config/routes.rb
119
124
  - lib/credible.rb
@@ -1,3 +0,0 @@
1
- %h1= "You have been invited to #{@app_name}"
2
- %p= "To login to the site, just follow this link: #{@url}."
3
- %p Thanks for joining and have a great day!
@@ -1,6 +0,0 @@
1
- = "You have been invited to #{@app_name}"
2
- \===============================================
3
-
4
- = "To login to the site, just follow this link: #{@url}."
5
-
6
- Thanks for joining and have a great day!