zaikio-oauth_client 0.4.4 → 0.5.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: 6d9eee4422926a02561d3e2301d775dc01d5db305df1c81133e5f39458394fa2
4
- data.tar.gz: b08b5e225a9e23c2a48c6533e5686df48b689a6953b7ee21459e8e2a884bda92
3
+ metadata.gz: 5423f9566cab7cd383ea7f42fa86c7a899e615be78eb3bf0f374a23742df8106
4
+ data.tar.gz: 5a2b07e3def1d7d55730767b1145265782d9bcde45fabbddace0ebd783c33915
5
5
  SHA512:
6
- metadata.gz: 4ac1c2f055825d2bd7b454aae2fbf2d6b89de39ce7a3dc396b798cfc3d03a515222098c354bbdaff4cf7c235542c3596a363a5efdaa064b6617f6ae8892b9a8c
7
- data.tar.gz: a233c429b205316024f52944ff25e48bf97e5d504f1a457a0f448d2563341f3cb9e5a6bf27cef6bed9214849d5eaf171f5ec575ea7a7a173e01c205a4e3b7c3d
6
+ metadata.gz: b5e9767b1c46ec96fe4ee6d12efd1b5090f0d032b3e651f2f941ce3ccae5a4151373ba1208a9c169f668cd2452c9701376989848a1465063fb731359d066e3b1
7
+ data.tar.gz: d14fb1595c1ae862873d4c38fc4ef6cd41b1f29088accca024d59f14f83e628fc91dcf7c70be64d9ccf62ca840c97125720c6b7d8c1873105e51d3b192779fda
data/README.md CHANGED
@@ -60,7 +60,7 @@ Zaikio::OAuthClient.configure do |config|
60
60
  end
61
61
 
62
62
  config.around_auth do |access_token, block|
63
- Zaikio::Directory.with_token(access_token.token) do
63
+ Zaikio::Hub.with_token(access_token.token) do
64
64
  block.call(access_token)
65
65
  end
66
66
  end
@@ -93,7 +93,7 @@ Configure sidekiq scheduler in `config/sidekiq.yml`:
93
93
 
94
94
  ### OAuth Flow
95
95
 
96
- From any point in your application you can start using the Zaikio Directory OAuth2 flow with
96
+ From any point in your application you can start using the Zaikio Hub OAuth2 flow with
97
97
 
98
98
  ```rb
99
99
  redirect_to zaikio_oauth_client.new_session_path
@@ -109,10 +109,10 @@ This will redirect the user to the OAuth Authorize endpoint of the Zaikio Direct
109
109
 
110
110
  The Zaikio gem engine will set a cookie for the user after a successful OAuth flow: `cookies.encrypted[:zaikio_person_id]`.
111
111
 
112
- If you are using for example `Zaikio::Directory::Models`, you can use this snippet to set the current user:
112
+ If you are using for example `Zaikio::Hub::Models`, you can use this snippet to set the current user:
113
113
 
114
114
  ```ruby
115
- Current.user ||= Zaikio::Directory::Models::Person.find_by(id: cookies.encrypted[:zaikio_person_id])
115
+ Current.user ||= Zaikio::Hub::Models::Person.find_by(id: cookies.encrypted[:zaikio_person_id])
116
116
  ````
117
117
 
118
118
  You can then use `Current.user` anywhere.
@@ -149,7 +149,7 @@ class ApplicationController < ActionController::Base
149
149
  cookies.encrypted[:zaikio_person_id] = access_token.bearer_id unless access_token.organization?
150
150
 
151
151
  # Sync data on login
152
- Zaikio::Directory.with_token(access_token.token) do
152
+ Zaikio::Hub.with_token(access_token.token) do
153
153
  access_token.bearer_klass.find_and_reload!(access_token.bearer_id, includes: :all)
154
154
  end
155
155
 
@@ -62,8 +62,8 @@ module Zaikio
62
62
  def bearer_klass
63
63
  return unless Zaikio.const_defined?("Directory::Models")
64
64
 
65
- if Zaikio::Directory::Models.configuration.respond_to?(:"#{bearer_type.underscore}_class_name")
66
- Zaikio::Directory::Models.configuration.public_send(:"#{bearer_type.underscore}_class_name").constantize
65
+ if Zaikio::Hub::Models.configuration.respond_to?(:"#{bearer_type.underscore}_class_name")
66
+ Zaikio::Hub::Models.configuration.public_send(:"#{bearer_type.underscore}_class_name").constantize
67
67
  else
68
68
  "Zaikio::#{bearer_type}".constantize
69
69
  end
@@ -1,5 +1,5 @@
1
1
  module Zaikio
2
2
  module OAuthClient
3
- VERSION = "0.4.4".freeze
3
+ VERSION = "0.5.0".freeze
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: zaikio-oauth_client
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.4
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Zaikio GmbH
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-01-20 00:00:00.000000000 Z
11
+ date: 2021-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails