isaca-rails 0.3.3 → 0.4.0

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
  SHA256:
3
- metadata.gz: 922003fa31906822aca1d5eb508147323572e9cee1af0895a74cf0114a22c871
4
- data.tar.gz: 5d095db805d31498d3d78c9b1abcd0a6039a535be6abe4d2afe38ce68dadf809
3
+ metadata.gz: d06cecd0537c57b9972bccd8f147bd4e5dd5827aa8a139960c84dd6c9545bb29
4
+ data.tar.gz: 2dacf9bbc7b3e89e343952aec7aa937549f93e49dc8c8aeeb9560716d9fcc7c8
5
5
  SHA512:
6
- metadata.gz: 265a170b8f57a5ce3f063aeac6561c8caa41d37171fb51792cb32bce2ae89e045d3f6707c8a1ec97159a8f8b4edf8a4dd0cba2ab1cb9d190c9219396512ddbe6
7
- data.tar.gz: 18e99a0d95d6ba22b80708173052dd5582e4b670861451ada70eafbf2526f2df0639a3f4410752dd417dbcb58e336b1882672de24d9c8489bba63b7d4241dfba
6
+ metadata.gz: aa885ba20b5b7d46ecc6036fff7d3577e60b95dcd44eba908f87a85cdc9e421acf41895a4a862019cdd38327bdc3fedad76c004441d410dcbf58d23a72b0e5f6
7
+ data.tar.gz: e1397c6576e41eae69fa3eabb4213d40a3174f409c4027eadef29b11dc8d6e837647fdb44054034560ba588c544b89dc4ad3b92bc27da6f913bce729bc6c2e9c
@@ -15,22 +15,29 @@ module Isaca
15
15
  #
16
16
  # @return nil
17
17
  def authenticate_isaca_user
18
- if user_signed_in?
19
- if request.path != user_consent_path && redirect_for_consent?
20
- session[:after_sign_in_path] = request.fullpath if request.get? && request.format.html?
21
- flash.alert = t('isaca.rails.user_consent.consent_required')
22
- redirect_to user_consent_path
23
- end
24
- else
25
- session[:after_sign_in_path] = request.fullpath if request.get?
26
- flash.alert = t('isaca.rails.sessions.sign_in_required')
27
-
28
- respond_to do |format|
29
- format.html {redirect_to sign_in_path}
30
- format.json do
31
- render json: {error: t('isaca.rails.sessions.sign_in_required')}.to_json, status: :unauthorized
18
+ begin
19
+ if user_signed_in?
20
+ if request.path != user_consent_path && redirect_for_consent?
21
+ session[:after_sign_in_path] = request.fullpath if request.get? && request.format.html?
22
+ flash.alert = t('isaca.rails.user_consent.consent_required')
23
+ redirect_to user_consent_path
24
+ end
25
+ else
26
+ session[:after_sign_in_path] = request.fullpath if request.get?
27
+ flash.alert = t('isaca.rails.sessions.sign_in_required')
28
+
29
+ respond_to do |format|
30
+ format.html {redirect_to sign_in_path}
31
+ format.json do
32
+ render json: {error: t('isaca.rails.sessions.sign_in_required')}.to_json, status: :unauthorized
33
+ end
32
34
  end
33
35
  end
36
+ rescue Isaca::ServiceError => e
37
+ cookies.delete('Token', domain: :all) if token_cookie_exists?
38
+ @current_isaca_user = nil
39
+ reset_session
40
+ redirect_to sign_in_path, alert: "ISACA Service Error: #{e.message}"
34
41
  end
35
42
  end
36
43
 
@@ -1,5 +1,5 @@
1
1
  module Isaca
2
2
  module Rails
3
- VERSION = '0.3.3'
3
+ VERSION = '0.4.0'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: isaca-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.3
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Matthew Orahood
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-01-15 00:00:00.000000000 Z
11
+ date: 2019-01-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails
@@ -30,14 +30,14 @@ dependencies:
30
30
  requirements:
31
31
  - - "~>"
32
32
  - !ruby/object:Gem::Version
33
- version: '1.2'
33
+ version: '1.3'
34
34
  type: :runtime
35
35
  prerelease: false
36
36
  version_requirements: !ruby/object:Gem::Requirement
37
37
  requirements:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
- version: '1.2'
40
+ version: '1.3'
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: sass-rails
43
43
  requirement: !ruby/object:Gem::Requirement