auth_provider 0.0.2 → 0.0.3

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
  SHA1:
3
- metadata.gz: 67b81bfaad52782109fb7ecb9ad7849305ea3e1c
4
- data.tar.gz: cc1688228983e20056848ed7bc370f9fd6d89fca
3
+ metadata.gz: 88b350c4634d62118d017e4805cb9d058b059f08
4
+ data.tar.gz: dceb1cb710f86d098b9b161e5ad213c7402b50e1
5
5
  SHA512:
6
- metadata.gz: f2b62887d8fd93da9393810f200160faba1641a077ffd73bb0ce0053efa3cdbdde1211095bb66ae18da0f36609292ee4d3ca7f06ce1663af293ad2d75c7efdb6
7
- data.tar.gz: a7564149ed84cb6d496b1d1152d54f22f61a21bb427e27bbb6c96a9bdd7c6c00e2ce78915eca7a97ba28d0a19a12db50105baa366bc1dcaa6fa7f301713d71cf
6
+ metadata.gz: 9eead206751d185d5ee30df594bbff680aa3d6f1c3df456fed529215c384631e8dd4c30944d86fc13666d888a09ebbbb482dbc3acc530626203bb485375f8bd8
7
+ data.tar.gz: 3bad8d521ec151437ee69cc771d5e894d8a6176688143cf0ee5ed9225681e0f1c46b2f88c4fd47195e7d4f1edeafefc73aa7aad2f4a7819ce3130a44052aa64e
@@ -1,4 +1,10 @@
1
1
  module AuthProvider
2
2
  module ApplicationHelper
3
+ def authenticated_resource_owner
4
+ access_token = request.headers[:Authorization]
5
+ return unless access_token
6
+ access_token = access_token.split(' ').last
7
+ AuthProvider.resource_owner_from_token(access_token)
8
+ end
3
9
  end
4
10
  end
@@ -1,5 +1,10 @@
1
1
  module AuthProvider
2
2
  class Engine < ::Rails::Engine
3
3
  isolate_namespace AuthProvider
4
+
5
+ config.to_prepare do
6
+ ::ApplicationController.include(AuthProvider::Engine.helpers)
7
+ ::ApplicationController.helper(AuthProvider::Engine.helpers)
8
+ end
4
9
  end
5
10
  end
@@ -1,3 +1,3 @@
1
1
  module AuthProvider
2
- VERSION = '0.0.2'
2
+ VERSION = '0.0.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auth_provider
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pokai Chang
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-08-16 00:00:00.000000000 Z
11
+ date: 2017-08-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails