entrance 0.6.2 → 0.6.3

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
  SHA1:
3
- metadata.gz: 5996654ada4c04abee0bd9be2fb49379d060b094
4
- data.tar.gz: c1055a74b922e5680f4788a63efa5f064318e8c6
3
+ metadata.gz: d5759bb6246fff29f44e5fe68a89f03055669e8f
4
+ data.tar.gz: bfdb45a1d698eb949e8c7b9d2bd3f12a0e8b200b
5
5
  SHA512:
6
- metadata.gz: 7cf71af823d741af14300925be03be29759eda16a6e46c9e49fd248d7da8cccdd2485e1951265c91a71177f55bf50bea728ef10372a2e29be0de134ee3aa177c
7
- data.tar.gz: eeb59011f0fb6b7edc0134eab2f15e507f5be29860138130fcc09a24490debdf19e06e9ca9020d6a3b221df25b322542b5e0cd234f91bf95d8a5fb04bd7d2ed8
6
+ metadata.gz: 8eb94d24ffd6a5d83f01bc57bcc607fd52da9ad39a24811d297bc9b54da0d4bc3b5ab50e3fbdbdf457dcf62f2d5878d2abf04f7626b8442c29cbc268bb28dc7b
7
+ data.tar.gz: 70bc8573bd81574d1a90fc9502d922c16b66777d2255f8654987ddd72897647959f9c239b78fd9453fde5f4392666565672a609bcec202f7bb3c660725ffb993
@@ -103,7 +103,7 @@ module Entrance
103
103
 
104
104
  def valid_user?(user)
105
105
  if user.respond_to?(:can_login?) and !user.can_login?
106
- return false
106
+ return false
107
107
  end
108
108
  user.valid?
109
109
  end
@@ -107,9 +107,11 @@ module Entrance
107
107
  end
108
108
  end
109
109
 
110
+ SKIP_STORE_PATHS = ['/favicon.ico']
111
+
110
112
  def store_location
111
- path = request.fullpath
112
- session[:return_to] = path unless ['/favicon.ico'].include?(path)
113
+ path = request.get? ? request.fullpath : request.env['HTTP_REFERER']
114
+ session[:return_to] = path unless path.blank? || SKIP_STORE_PATHS.include?(path)
113
115
  end
114
116
 
115
117
  def redirect_to_stored_or(default_path)
@@ -1,7 +1,7 @@
1
1
  module Entrance
2
2
  MAJOR = 0
3
3
  MINOR = 6
4
- PATCH = 2
4
+ PATCH = 3
5
5
 
6
6
  VERSION = [MAJOR, MINOR, PATCH].join('.')
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: entrance
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.2
4
+ version: 0.6.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Tomás Pollak
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-05-10 00:00:00.000000000 Z
11
+ date: 2018-09-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bcrypt