forest_liana 3.0.0.pre.beta.14 → 3.0.0.pre.beta.15

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: 199c9c576c91f26b5f63ff42c4d68efd66d64937
4
- data.tar.gz: 42d49929c4790be75f504be49438166f36958c2c
3
+ metadata.gz: 94f79f5df9cdac1a5b97d2f04c76d48a8a116e1a
4
+ data.tar.gz: f47790fdddff55d8d02e433ea17e462b073564f0
5
5
  SHA512:
6
- metadata.gz: a05a763794851c860a06cd50e81df2235f1eb41276c42dec89d5526edf93ae93fe250bc311cbda6d69268d70df8074b341274eed988782b2c2b831a441a126af
7
- data.tar.gz: 0b002ecb9965bc67cc52c77bf51ae0512a28168054740e17fb17e6f0a256c7805fb1bebdd30cacd43140ea5e8a4a21a6365d50a6fe500d5ffdebea8506183822
6
+ metadata.gz: 4b0913455deaf13fa8573e6447fdd99481b9ce9dc510d208a70aed5b54e5ca71fd7794b2b8803873f3b882f750430ffc3e6a4eee3c65ef08bebea3b25b16a0cb
7
+ data.tar.gz: 2afc4b23ee3a03f932db9231e38f5e7704759ade5632d0b87908c9d0120bf1eab73cdf2b6bea34c286d652f53b5840ded7863e351f50388ec0971dd1177a5590
@@ -3,6 +3,8 @@ require 'csv'
3
3
 
4
4
  module ForestLiana
5
5
  class ApplicationController < ForestLiana::BaseController
6
+ REGEX_COOKIE_SESSION_TOKEN = /sessionToken=(.*);?/;
7
+
6
8
  def self.papertrail?
7
9
  Object.const_get('PaperTrail::Version').is_a?(Class) rescue false
8
10
  end
@@ -56,11 +58,13 @@ module ForestLiana
56
58
 
57
59
  def authenticate_user_from_jwt
58
60
  begin
59
- if request.headers['Authorization'] || params['sessionToken']
61
+ if request.headers
60
62
  if request.headers['Authorization']
61
63
  token = request.headers['Authorization'].split.second
62
- else
63
- token = params['sessionToken']
64
+ # NOTICE: Necessary for downloads authentication.
65
+ elsif request.headers['cookie']
66
+ match = REGEX_COOKIE_SESSION_TOKEN.match(request.headers['cookie'])
67
+ token = match[1] if match && match[1]
64
68
  end
65
69
 
66
70
  @jwt_decoded_token = JWT.decode(token, ForestLiana.auth_secret, true,
@@ -1,3 +1,3 @@
1
1
  module ForestLiana
2
- VERSION = "3.0.0-beta.14"
2
+ VERSION = "3.0.0-beta.15"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: forest_liana
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.0.0.pre.beta.14
4
+ version: 3.0.0.pre.beta.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Sandro Munda
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-01 00:00:00.000000000 Z
11
+ date: 2019-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails