artsy-auth 0.1.0 → 0.1.1

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: 1cf1e6c6b3b49a4acdcd25dccd98ce3ae28a04c7
4
- data.tar.gz: 04708d532731280d1043d3613c775351a027f699
3
+ metadata.gz: c3a31a866abd792a5c58653213d24593b9930d5e
4
+ data.tar.gz: fdcc19637bc045820e591222e195cf46ec815d6e
5
5
  SHA512:
6
- metadata.gz: 89a733670ad984119f5a7d03ff96d22ff9fbe15c4f313fcdf3a3623e5d6463fabce0e6aa611528310fcea0786d22b76387eb3153abd0463adcbb4e92f22d73f8
7
- data.tar.gz: 87b350bdbb4270269baebe4d50ae9fc7ec63a3e2baebfd3baee6d6e78454d6d3fc57beae4cd472fd8d6c3b059b390216ca8ddbd9b2f2265f9711713f145e61e9
6
+ metadata.gz: e4b2a50200544255fc2ebbf5d646286a65934baef8a2c6598ac7c0d600a1b75385c495ad9ae04d760aa3d35ffa6d8f4a8bd29b7e9829e002d0ecc0211bff0434
7
+ data.tar.gz: 392c45f7b799b6c880a22f113314912bf311145b9bf085d2723480a75efa359db2462ec45d2ae4221bc38b07d28ee4165458db916061752ad9e23982640b7641
data/README.md CHANGED
@@ -1,4 +1,4 @@
1
- # Artsy Authentication
1
+ # Artsy Authentication [![Build Status](https://travis-ci.org/artsy/artsy-auth.svg?branch=master)](https://travis-ci.org/artsy/artsy-auth)
2
2
 
3
3
  Ruby Gem for adding Artsy's omniauth based authentication to your app.
4
4
 
@@ -13,7 +13,7 @@ gem 'artsy-auth'
13
13
  Artsy Auth is based on [`Rails::Engine`](http://api.rubyonrails.org/classes/Rails/Engine.html).
14
14
 
15
15
  ### Configure
16
- Add `artsy_auth.rb` under `config/initializer`. We need to configure `ArtsyAuth` to use proper Artsy `application_id` and `application_secret`. Also it needs `artsy_url` which will be used to redirect `sign_out` to proper location.
16
+ Add `artsy_auth.rb` under `config/initializers`. We need to configure `ArtsyAuth` to use proper Artsy `application_id` and `application_secret`. Also it needs `artsy_url` which will be used to redirect `sign_out` to proper location.
17
17
  `callback_url` defines after a successful omniauth handshake, where should we get redirected to.
18
18
 
19
19
  ```ruby
@@ -30,7 +30,7 @@ You also need to mount session related endpoints to your app, in your `config/ro
30
30
  mount ArtsyAuth::Engine => '/'
31
31
  ```
32
32
 
33
- In order to force authenticaiton, you need to change your `ApplicationController` to inherit from ` ArtsyAuth::ApplicationController`, you also need to add (override) `authorize?` method there which gets a token and in your app you need to define how do you authorize that token, for example:
33
+ In order to force authentication, you need to change your `ApplicationController` to inherit from ` ArtsyAuth::ApplicationController`, you also need to add (override) `authorize?` method there which gets a token and in your app you need to define how do you authorize that token, for example:
34
34
  ```ruby
35
35
  class ApplicationController < ArtsyAuth::ApplicationController
36
36
  # Prevent CSRF attacks by raising an exception.
@@ -43,7 +43,7 @@ class ApplicationController < ArtsyAuth::ApplicationController
43
43
  end
44
44
  end
45
45
  ```
46
- Note that this will add authenticaiton to all of your controllers, if you want to skip Artsy's authentication for specific controller you can skip it in your controller by adding:
46
+ Note that this will add authentication to all of your controllers, if you want to skip Artsy's authentication for specific controller you can skip it in your controller by adding:
47
47
  ```ruby
48
48
  class TestController
49
49
  skip_before_action :require_artsy_authentication
@@ -3,8 +3,8 @@ module ArtsyAuth
3
3
  end
4
4
 
5
5
  ArtsyAuth.config = OpenStruct.new(
6
- artsy_url: ENV['artsy_url'] || 'http://localhost:3000',
7
- callback_url: ENV['callback_url'] || 'http://localhost:3000/',
8
- application_id: ENV['application_id'],
9
- application_secret: ENV['application_secret']
6
+ artsy_url: nil,
7
+ callback_url: '/',
8
+ application_id: nil,
9
+ application_secret: nil
10
10
  )
@@ -5,7 +5,7 @@ module ArtsyAuth
5
5
  session[:user_id] = auth_hash['uid']
6
6
  session[:email] = auth_hash['info']['raw_info']['email']
7
7
  session[:access_token] = auth_hash['credentials']['token']
8
- redirect_to "#{ArtsyAuth.config[:callback_url]}"
8
+ redirect_to ArtsyAuth.config[:callback_url]
9
9
  end
10
10
 
11
11
  def destroy
@@ -1,3 +1,3 @@
1
1
  module ArtsyAuth
2
- VERSION = '0.1.0'.freeze
2
+ VERSION = '0.1.1'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: artsy-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Artsy