oauth_im 0.12.0 → 0.12.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
  SHA256:
3
- metadata.gz: decb65e3a5b2753a1a2ecc5dd73f7e149724278cf1a7ec8ac8083668ab99da2f
4
- data.tar.gz: d5e22d069de29e8a9b4b5f3deaae75dcf89b4602b098380d65678cce6938b553
3
+ metadata.gz: 364497681f86814ce9f653bb9bfbce1e205f290fefb89efd57909fd0abf8b9a4
4
+ data.tar.gz: 7186e2c813011b1687d2a03e54ea3a7a2582a5cd4291896772b36171cecae16d
5
5
  SHA512:
6
- metadata.gz: 859e9ea75b6ba0505cee390e3edb0c7119aef4225447470a31d0e330017d15ca69c4b4f179a7cd6582f61b77b41396b6ef8d3028c7eefca648f0448cb6f8aa36
7
- data.tar.gz: 69ef30f3cb1800dffdae068043db0b1328e860994d23a8759fefe64123bb7bac07a70e22e78bd7171774db2cf302633a9f33151c1c1001bc7ddf97c81c9effa0
6
+ metadata.gz: abc834522d265fa3d6257125a5ee18b75a2101e49b2702b493b94bcf8b97ad0ba7d763d4adaa9f71379bbc310939c18fcaba7059994e6c3aac4aa3d052a2878b
7
+ data.tar.gz: 04ad73bded20cbc1efdeb1fdc1c1e6b1482b06ae7ee8482b89698b858933a2d3dfb25047065033a5029103c5728292cdd489f621641f4eab77decb640c475c3d
@@ -12,6 +12,7 @@ module OauthIm
12
12
 
13
13
  delegate :email, :email_verified?,
14
14
  :user_is_sponsor?,
15
+ :current_user_id,
15
16
  :admin?,
16
17
  to: :user_client,
17
18
  allow_nil: true
@@ -4,9 +4,14 @@ require 'oauth2'
4
4
 
5
5
  module OauthIm
6
6
  class ClientController < OauthIm::ApplicationController
7
+ delegate :oauth_rescue_redirect_path, to: :configuration
8
+
7
9
  def callback
8
10
  session[:user_jwt] = user_jwt
9
11
  redirect_to main_app.root_path
12
+ rescue StandardError => e
13
+ Rollbar.warning "rescue OauthIm::ClientController#callback: #{request.original_url} #{e.message}"
14
+ redirect_to oauth_rescue_redirect_path
10
15
  end
11
16
 
12
17
  def login
@@ -25,8 +25,14 @@ module OauthIm
25
25
  jwt_token[:roles].include? 'admin'
26
26
  end
27
27
 
28
+ alias current_user_id application_id
29
+
28
30
  private
29
31
 
32
+ def application_id
33
+ @application_id ||= jwt_token[:applicationId]
34
+ end
35
+
30
36
  def attrs
31
37
  @attrs ||= success_response[:user] || {}
32
38
  end
@@ -17,6 +17,7 @@ module OauthIm
17
17
  client_secret
18
18
  hmac
19
19
  rsa_public
20
+ oauth_rescue_redirect_path
20
21
  ].freeze
21
22
 
22
23
  class Configuration
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module OauthIm
4
- VERSION = '0.12.0'
4
+ VERSION = '0.12.2'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oauth_im
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.12.0
4
+ version: 0.12.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Connally
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-09-15 00:00:00.000000000 Z
11
+ date: 2022-09-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: fusionauth_client