user_authentication 0.2.1 → 0.2.2

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aa942b263d34b28938621321b9458bcee734dff6
4
- data.tar.gz: c35920a6443f9455c1bb773b0fcb50c1d33bd8eb
3
+ metadata.gz: 5c8b1691ba9a0656d78f9b4ead0f924766db2474
4
+ data.tar.gz: 3790adc45865fb6c5128a9ec09bee93fbcdda9ae
5
5
  SHA512:
6
- metadata.gz: 2a9de581fcdac92e436b4ba7d0983c473259a9d7069541172c74423be7b864d5bba0a193cba1d3a1d9a2a974b51f15f9d82224da12fbe79fc6029bcd66565038
7
- data.tar.gz: da295669aadc9fd7820eae201b96d5c6ce8efdb23c82ef8ca669b322e67735ed5e2cdb3e143bfccfada80699172e75d7f463ad8f838b17802ce7a9a48a37e791
6
+ metadata.gz: de9db33d6dd091ccabc1fe46f05eadaabc636f1b2353ca88316a34c93d67a445c975b43ba4e5d2485daef5b04fadd2cf75f823694e2799597ac48ab8cbe273dd
7
+ data.tar.gz: e1f5c3564b7563be06c92ed62edda49c83eaa6f6bfb467510014462d877333ded92aa326cb1106f3d1ed4e473fc2afa12d3ab833bbca7c87e11c3ccf99a9c29d
@@ -7,13 +7,13 @@ class ApplicationController < ActionController::Base
7
7
  def authorize(redirect=nil)
8
8
  # Not using skip_before_filter, since main app could inadvertently override that
9
9
  # by using a before_filter :authorize in its application_controller.
10
- if params[:controller] == "users" && ["do_login", "login", "logout", "do_signup", "signup"].include?(params[:action])
10
+ if params[:controller] == 'users' && ['do_login', 'login', 'logout', 'do_signup', 'signup'].include?(params[:action])
11
11
  return true
12
12
  end
13
13
 
14
14
  if current_user.nil?
15
15
  session[:redirect] = url_for params
16
- redirect_to redirect || login_path, alert: "Please log in to access this page."
16
+ redirect_to redirect || login_path, alert: 'Please log in to access this page.'
17
17
  else
18
18
  return true
19
19
  end
@@ -35,8 +35,8 @@ class ApplicationController < ActionController::Base
35
35
 
36
36
  def redirect
37
37
  session_redirect = session.delete(:redirect)
38
- redirect_to params[:redirect] || session_redirect || :back
38
+ redirect_to params[:redirect] || session_redirect || root_path
39
39
  end
40
40
  end
41
41
 
42
- require File.join Rails.root, "app/controllers/application_controller"
42
+ require File.join Rails.root, 'app/controllers/application_controller'
@@ -19,7 +19,7 @@ class UsersController < ApplicationController
19
19
  redirect
20
20
  end
21
21
  else
22
- redirect_to :back, alert: "Please check email and password."
22
+ redirect_to :back, alert: 'Please check email and password.'
23
23
  end
24
24
  end
25
25
 
@@ -30,7 +30,7 @@ class UsersController < ApplicationController
30
30
  if respond_to? :on_logout
31
31
  on_logout
32
32
  else
33
- redirect_to :back
33
+ redirect_to params[:redirect] || root_path
34
34
  end
35
35
  end
36
36
 
@@ -1,3 +1,3 @@
1
1
  module UserAuthentication
2
- VERSION = '0.2.1'
2
+ VERSION = '0.2.2'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: user_authentication
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sujoy Gupta
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-10-02 00:00:00.000000000 Z
11
+ date: 2014-11-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails