auth1 0.5.0 → 0.6.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 +16 -4
- data/lib/auth1/version.rb +1 -1
- data/lib/generators/auth1/USAGE +9 -0
- data/lib/generators/auth1/install_generator.rb +29 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: ab62e55c9216be06974fa4dd54b5d003c7821a45f3ffa89718e83199579c54f0
|
4
|
+
data.tar.gz: d59a75ac60f21c8771a4f2081aa69307b3b5c4158e6dd52cb42c0a260df141e3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0bdf1f388ebe93068d18595a65d32d6bf73a9d0848b562a50f88983978985d2c345fd8145836fd66c6bda9bd104c3a80765acf075bc592c57542970ddf8586e1
|
7
|
+
data.tar.gz: 2e536940f599dc60555758accd786c561f5f3f8d023877e121b9147d220b9ca544d5273da7b497000a340475a31fd48fd67ac1579be0feefbcff58d00e8d190a
|
data/README.md
CHANGED
@@ -36,12 +36,14 @@ Add this line to your application's Gemfile:
|
|
36
36
|
gem 'auth1'
|
37
37
|
```
|
38
38
|
|
39
|
-
|
39
|
+
Then run `bundle install`.
|
40
|
+
|
41
|
+
Next, run the Auth1 install generator:
|
40
42
|
```bash
|
41
|
-
|
43
|
+
rails g auth1:install
|
42
44
|
```
|
43
45
|
|
44
|
-
|
46
|
+
This will add the following environment variables to `.env.local` if you are using [dotenv-rails](https://github.com/bkeepers/dotenv) gem:
|
45
47
|
```bash
|
46
48
|
# Values from https://manage.auth0.com/#/applications
|
47
49
|
AUTH0_CLIENT_ID
|
@@ -52,7 +54,17 @@ AUTH0_DOMAIN
|
|
52
54
|
AUTH0_LOGOUT_URL
|
53
55
|
```
|
54
56
|
|
55
|
-
|
57
|
+
If you're not using `dotenv-rails` gem, just set the above environment variables yourself.
|
58
|
+
|
59
|
+
This will also mount Auth1 routes in your application by adding the following to `config/routes.rb`:
|
60
|
+
```ruby
|
61
|
+
# config/routes.rb
|
62
|
+
Rails.application.routes.draw do
|
63
|
+
mount Auth1::Engine => '/'
|
64
|
+
end
|
65
|
+
```
|
66
|
+
|
67
|
+
Update **Allowed Callback URLs** field in [Auth0 Application Settings](https://manage.auth0.com/#/applications). For local development, you can set this value to `http://localhost:3000/auth/auth0/callback`.
|
56
68
|
|
57
69
|
Update **Allowed Logout URLs** field in [Auth0 Application Settings](https://manage.auth0.com/#/applications) with the same value in `AUTH0_LOGOUT_URL` environment variable.
|
58
70
|
|
data/lib/auth1/version.rb
CHANGED
@@ -0,0 +1,29 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
|
3
|
+
module Auth1
|
4
|
+
module Generators
|
5
|
+
class InstallGenerator < Rails::Generators::Base
|
6
|
+
desc 'Mount Auth1 routes and add environment variables.'
|
7
|
+
|
8
|
+
def update_routes
|
9
|
+
route "mount Auth1::Engine => '/'"
|
10
|
+
end
|
11
|
+
|
12
|
+
def add_auth0_env_vars
|
13
|
+
return unless defined?(Dotenv)
|
14
|
+
|
15
|
+
inject_into_file '.env.local' do
|
16
|
+
<<~HEREDOC
|
17
|
+
# Values from https://manage.auth0.com/#/applications
|
18
|
+
AUTH0_CLIENT_ID='AUTH0_CLIENT_ID'
|
19
|
+
AUTH0_CLIENT_SECRET='AUTH0_CLIENT_SECRET'
|
20
|
+
AUTH0_DOMAIN='AUTH0_DOMAIN'
|
21
|
+
|
22
|
+
# URL in your application to redirect to after logout from Auth0
|
23
|
+
AUTH0_LOGOUT_URL='http://localhost:3000/'
|
24
|
+
HEREDOC
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
29
|
+
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.
|
4
|
+
version: 0.6.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-
|
11
|
+
date: 2020-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: omniauth-auth0
|
@@ -144,6 +144,8 @@ files:
|
|
144
144
|
- lib/auth1.rb
|
145
145
|
- lib/auth1/engine.rb
|
146
146
|
- lib/auth1/version.rb
|
147
|
+
- lib/generators/auth1/USAGE
|
148
|
+
- lib/generators/auth1/install_generator.rb
|
147
149
|
- lib/tasks/auth1_tasks.rake
|
148
150
|
homepage: https://github.com/seouri/auth1
|
149
151
|
licenses:
|