auth1 0.7.0 → 0.8.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: 81bf338779bcb9bdcd845b3f94694f01ca02ffcdb3a84327ea95becd922a41f4
4
- data.tar.gz: be0da299fbaeca8eebf539f9b546e81b668076cfec79d7116e556271dadf4058
3
+ metadata.gz: debe2fe6e04f03f6382ee22490206c11b1720c8be37c3bf8573240e5617ba76e
4
+ data.tar.gz: 45d359c51e4dd0de41bd4fb376c229800f42c1a4d8f91cc199dc68398593138c
5
5
  SHA512:
6
- metadata.gz: 764fbf8f015239583cdf2bbf60d0ace7e63350d0c117bbd39385a52e06b606aba79747a6e9f4811ed97c72cde78c966d72e76dbfa2ab28dd1a8627ec414b47a6
7
- data.tar.gz: 2f9acae1169921cf828d7ae7a14b290dd12cf3048520ee9326df89f88fb9248c9c8f97a93469f82038b0af66a591e9d2676dbb3b7a01222ceebb394da8bfe8a6
6
+ metadata.gz: 30d455a70319c6b29595eba59dd89eb34219865cf1be7d9dbbcf2374cd9f8f2cf7c707098172c0788f8fb5cdc1367114975053b076c41edb9d4b16801fd814c6
7
+ data.tar.gz: 71a5749de2ab50743bc157624508154275991b369c91a847077c9b549d04d76dc135e4375a251052c8105b371abc85ee96e6761ea2598abf167315f7199d10d1
data/README.md CHANGED
@@ -29,6 +29,13 @@ Auth1 is a [Rails Engine](https://guides.rubyonrails.org/engines.html) for [Auth
29
29
  <%= login_or_logout_button %>
30
30
  ```
31
31
 
32
+ ### URL Helpers
33
+ ```ruby
34
+ auth1.callback_url
35
+ auth1.failure_url
36
+ auth1.logout_url
37
+ ```
38
+
32
39
  ## Installation
33
40
  Add this line to your application's Gemfile:
34
41
 
@@ -2,8 +2,12 @@
2
2
 
3
3
  module Auth1
4
4
  module SessionsHelper
5
+ def login_path
6
+ '/auth/auth0'
7
+ end
8
+
5
9
  def login_button(name = 'Login', options = nil, html_options = nil, &block)
6
- options ||= '/auth/auth0'
10
+ options ||= login_path
7
11
  html_options ||= {}
8
12
  html_options[:method] = :post
9
13
  button_to(name, options, html_options, &block)
@@ -29,7 +33,7 @@ module Auth1
29
33
  end
30
34
 
31
35
  def login_link(name = 'Login', options = nil, html_options = nil, &block)
32
- options ||= '/auth/auth0'
36
+ options ||= login_path
33
37
  html_options ||= {}
34
38
  html_options[:method] = :post
35
39
  link_to(name, options, html_options, &block)
@@ -6,7 +6,7 @@ Auth1::Engine.config.middleware.use OmniAuth::Builder do
6
6
  ENV['AUTH0_CLIENT_ID'],
7
7
  ENV['AUTH0_CLIENT_SECRET'],
8
8
  ENV['AUTH0_DOMAIN'],
9
- callback_path: '/auth/auth0/callback',
9
+ callback_path: Auth1::Engine.routes.url_helpers.callback_path,
10
10
  authorize_params: {
11
11
  scope: 'openid email profile'
12
12
  }
@@ -1,7 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  Auth1::Engine.routes.draw do
4
- get 'auth/auth0/callback', to: 'sessions#callback'
5
- get 'auth/failure', to: 'sessions#failure'
4
+ get 'auth/auth0/callback', to: 'sessions#callback', as: "callback"
5
+ get 'auth/failure', to: 'sessions#failure', as: "failure"
6
6
  get 'logout', to: 'sessions#logout'
7
7
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Auth1
4
- VERSION = '0.7.0'
4
+ VERSION = '0.8.0'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: auth1
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.7.0
4
+ version: 0.8.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Joon Lee
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-05-02 00:00:00.000000000 Z
11
+ date: 2020-05-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: omniauth-auth0