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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 87e31158ba864d33d332a4c8d3f51fc22c6efc40f9b7b152c599853af6a3beed
4
- data.tar.gz: c374e105ca45b58945e28b9609e2551227d23ba029dc4ff98314cf650c7169ce
3
+ metadata.gz: ab62e55c9216be06974fa4dd54b5d003c7821a45f3ffa89718e83199579c54f0
4
+ data.tar.gz: d59a75ac60f21c8771a4f2081aa69307b3b5c4158e6dd52cb42c0a260df141e3
5
5
  SHA512:
6
- metadata.gz: 6fa02f1713470b70eda1f4cffc1482ae49a797f6520fe8e6786563fefe1a5725703b7dac125d65b951d7eb75805c8240d36cc18d68443b4281b3e2820b40dd3f
7
- data.tar.gz: ff5ee901c1fbfba45d744d3f99b06a29349aa2a6bbda6bd737366795ae76b88c1fe7c09902858f144bbefed71203075b4b41b85f90fb1d3714d01e0c927f7a07
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
- And then execute:
39
+ Then run `bundle install`.
40
+
41
+ Next, run the Auth1 install generator:
40
42
  ```bash
41
- $ bundle
43
+ rails g auth1:install
42
44
  ```
43
45
 
44
- Set the following environment variables:
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
- 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`git.
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Auth1
4
- VERSION = '0.5.0'
4
+ VERSION = '0.6.0'
5
5
  end
@@ -0,0 +1,9 @@
1
+ Description:
2
+ Mount Auth1 routes and add environment variables.
3
+
4
+ Example:
5
+ rails generate auth1:install
6
+
7
+ This will update:
8
+ .env.local
9
+ config/routes.rb
@@ -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.5.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-04-06 00:00:00.000000000 Z
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: