tkh_authentication 0.1.10 → 0.1.11

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- YTI1YWNhMzk1MmJkYTIwZjMzMWE0ZTFmMTg3OGE2NDMwMjEwZDUzNg==
4
+ ODU5ZDNhMDM0ZmQ0ZDI4MzhmYjRhODZhZDUzNWY4ZjJlNDk0YzFlMg==
5
5
  data.tar.gz: !binary |-
6
- OTYwYjBjMDEwYThmNDZlYzkyNzA2ZTNjZDQ0ZmFkYTZlNzI4OTBiNg==
6
+ MTkxMmM0ZDZlMmE0MWE2YmVhN2MwYWY5ZDcwMzgyMzBhM2EwMjNjYw==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YjUzYTJmYmM2Mjc2YTMyMTJkYTBhNTYxMDcxNDZjZmM2OGU2M2VlZWU5MjYw
10
- ODZiOTA0NGRkNmFmNDlmMGFjOGUwZDNhYzk3ZTAxNmEyMmVjMjE5MWFiNWI5
11
- NGVhZDE0ZGJhODAyN2JhY2MwZDFhYTQ1OGUzNzVmNmRkODhlMjI=
9
+ MWE5MTk3MjMzNThjYTNlNDliMTJiYTU0OGQ5NmY1OWQwYmJkOTczMjMzOTRi
10
+ MGQzMDk2MTlmOWE0NDBhYjI3OGQ3ODg3NjY0ZTZjMzZiODI5OWM5YjM4ZWVj
11
+ MmRiNWU2OWMyZTdkZjg0MGM4NTQ0YmY4NGY5NTQwZmMzNzQyMGY=
12
12
  data.tar.gz: !binary |-
13
- YmI4NTZkODZiMTBmNmI5Njk2NzE5MmMxZmUzNGFlNTMwNTRjZGM2ODFjNmM0
14
- Mzc3MTNhYjI3ZWM0NmE5NjM5OTQ0NmRkNTJlZDIwNjRlY2VmN2EzZDRiNWM3
15
- N2U3ZjgyYTliMjAxMzc3YjdhZDQxYzIxNWY4MDFlODdmZTQ0NGE=
13
+ M2NjZTNmZTliMTMwZDJlZTkxZjMyZTcwNTNmNGYxNzFiOTJkN2ZjNzNhNDE5
14
+ NmViNzQzZmNmODNjNGRjNTc4MGRkZDBkNDg1Yjc2ODhmNDdmOWVkNDFiNGIw
15
+ MTg2YjRjZWRhMTYyYTNmZTg2MjU3ZTljZDg1OTBlN2FkNTUwZGE=
data/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # TKH Authentication
2
2
 
3
3
 
4
+ ## 0.1.11
5
+
6
+ * Ensure the target page is always set and removed when needed to improve the click-flow of users signing in or creating an account.
7
+ * When user is redirected to login page from the detect address view, his entered email address follows with.
8
+
9
+
4
10
  ## 0.1.10
5
11
 
6
12
  * Debugged the user has comments dependent destroy bug
@@ -21,9 +21,16 @@ class PasswordResetsController < ApplicationController
21
21
  elsif @user.update_attributes(params[:user])
22
22
  cookies[:auth_token] = @user.auth_token # logging in the user
23
23
  redirect_to session[:target_page] || safe_root_url, notice: t('authentication.password_reset_confirmation')
24
+ destroy_target_page
24
25
  else
25
26
  render :edit
26
27
  end
27
28
  end
28
29
 
30
+ private
31
+
32
+ def destroy_target_page
33
+ session[:target_page] = nil
34
+ end
35
+
29
36
  end
@@ -15,7 +15,7 @@ class SessionsController < ApplicationController
15
15
  cookies[:auth_token] = user.auth_token
16
16
  end
17
17
  redirect_to (session[:target_page] || safe_root_url), notice: t('authentication.login_confirmation')
18
- session[:target_page] = nil
18
+ destroy_target_page
19
19
  else
20
20
  flash.now.alert = t('authentication.warning.email_or_password_invalid')
21
21
  render "new"
@@ -24,6 +24,7 @@ class SessionsController < ApplicationController
24
24
 
25
25
  def destroy
26
26
  cookies.delete(:auth_token)
27
+ destroy_target_page
27
28
  redirect_to safe_root_url, notice: t('authentication.logout_confirmation')
28
29
  end
29
30
 
@@ -33,4 +34,8 @@ class SessionsController < ApplicationController
33
34
  session[:target_page] = request.referer unless session[:target_page] # && !request.referer.nil?
34
35
  end
35
36
 
37
+ def destroy_target_page
38
+ session[:target_page] = nil
39
+ end
40
+
36
41
  end
@@ -26,10 +26,11 @@ class UsersController < ApplicationController
26
26
 
27
27
  def detect_existence
28
28
  set_target_page
29
- user = User.where('email = ?', params[:user][:email]).first
29
+ @detected_email = params[:user][:email]
30
+ user = User.where('email = ?',@detected_email).first
30
31
  if user && !user.password_digest.blank? && user.password != 'temporary'
31
32
  flash[:notice] = "Our records show you have an account with us. Please login."
32
- redirect_to login_path
33
+ redirect_to login_path(email: @detected_email)
33
34
  else
34
35
  if user
35
36
  newbie = Newbie.where('email = ?', params[:user][:email]).first
@@ -1,7 +1,6 @@
1
1
  <%= form_tag sessions_path, class: 'simple_form form-horizontal' do %>
2
2
 
3
3
  <div class="form-inputs">
4
-
5
4
  <div class="control-group email required">
6
5
  <%= label_tag :email, t('activerecord.attributes.user.email'), class: "email required control-label" %>
7
6
  <div class="controls">
@@ -9,7 +8,7 @@
9
8
  <p class="help-block"><%= link_to t('authentication.not_registered'), signup_path %></p>
10
9
  </div>
11
10
  </div>
12
-
11
+
13
12
  <div class="control-group password required">
14
13
  <%= label_tag :password, t('activerecord.attributes.user.password'), class: "password required control-label" %>
15
14
  <div class="controls">
@@ -23,11 +22,11 @@
23
22
  <label class="checkbox"><input class="boolean optional" id="remember_me" name="remember_me" type="checkbox" value="1" /><%= t('authentication.remember_me') %></label>
24
23
  </div>
25
24
  </div>
26
-
25
+
27
26
  </div>
28
-
27
+
29
28
  <div class="form-actions">
30
29
  <%= submit_tag t('authentication.login_now'), class: 'btn btn-primary' %>
31
30
  </div>
32
-
33
- <% end %>
31
+
32
+ <% end %>
@@ -1,3 +1,3 @@
1
1
  module TkhAuthentication
2
- VERSION = "0.1.10"
2
+ VERSION = "0.1.11"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tkh_authentication
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.10
4
+ version: 0.1.11
5
5
  platform: ruby
6
6
  authors:
7
7
  - Swami Atma
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-08-04 00:00:00.000000000 Z
11
+ date: 2013-08-05 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails