auth1 0.7.0 → 0.8.0
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 +4 -4
- data/README.md +7 -0
- data/app/helpers/auth1/sessions_helper.rb +6 -2
- data/config/initializers/auth0.rb +1 -1
- data/config/routes.rb +2 -2
- data/lib/auth1/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: debe2fe6e04f03f6382ee22490206c11b1720c8be37c3bf8573240e5617ba76e
|
4
|
+
data.tar.gz: 45d359c51e4dd0de41bd4fb376c229800f42c1a4d8f91cc199dc68398593138c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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 ||=
|
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 ||=
|
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:
|
9
|
+
callback_path: Auth1::Engine.routes.url_helpers.callback_path,
|
10
10
|
authorize_params: {
|
11
11
|
scope: 'openid email profile'
|
12
12
|
}
|
data/config/routes.rb
CHANGED
@@ -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
|
data/lib/auth1/version.rb
CHANGED
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.
|
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-
|
11
|
+
date: 2020-05-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-auth0
|