rodauth-omniauth 0.3.1 → 0.3.2

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: bac8b21270ddf567a6ecaec293f34de53f683dfdc83d471ce0e0d422e8b60a71
4
- data.tar.gz: aed02da319f49450d5e11358e94b40631a16dc466d26be07e9a049cf305f0d18
3
+ metadata.gz: c6cc26306c21226fb3b6f07fcc3bfcc6390160f78aa0c8cbf87ff3e3b1fd2fd4
4
+ data.tar.gz: 9f3d0493b66cdb851e1b8af0e1d85e57544fcdaa6504509072a4edfdcde24d5f
5
5
  SHA512:
6
- metadata.gz: e364a12a3d8d610cbe9192b2597374ee532c1b95179f6851a1461c9aaf6d975650ffc9aed989fef192e97f846d07cc8dca92f85833765963b865132b426cf5b6
7
- data.tar.gz: '05490ea6ae366d7548ab3a02026c80c4d10ba0e5de5bc9adfba9a87db7b48f05d8732394c554be352330d21a1f78e2727b013e25c3cd3f91fa2d92702ca0ecc3'
6
+ metadata.gz: c10572574a109db2a9d28ea84239154f7c380b23d4f48f543c3084ae6528c5b2878ed98adab2c9d489ced01ca106cd354b7f5dfa177e496b048c744082ddeb31
7
+ data.tar.gz: 60cf2d25aa82ccb6a6a9f69c01fca040912df718d952a7ad830e443b89589a11d9855d042298c34c1220548b1a4a3eb96252e992de0d8214b1e43f0f4add08f4
data/README.md CHANGED
@@ -43,7 +43,7 @@ end
43
43
  Then enable the `omniauth` feature and register providers in your Rodauth configuration:
44
44
 
45
45
  ```sh
46
- $ bundle add omniauth-facebook omniauth-twitter, omniauth-google_oauth2
46
+ $ bundle add omniauth-facebook omniauth-twitter, omniauth-google-oauth2
47
47
  ```
48
48
  ```rb
49
49
  plugin :rodauth do
@@ -55,6 +55,8 @@ plugin :rodauth do
55
55
  end
56
56
  ```
57
57
 
58
+ It is important to note that `rodauth-omniauth` requires OmniAuth 2.x, and as such, is only compatible with omniauth gems that use the same.
59
+
58
60
  You can now add authentication links to your login form:
59
61
 
60
62
  ```erb
@@ -191,8 +193,8 @@ The `omniauth` feature builds on top of the `omniauth_base` feature, which sets
191
193
  plugin :rodauth do
192
194
  enable :omniauth_base
193
195
 
194
- omniauth_provider :github, ENV["GITHUB_KEY"], ENV["GITHUB_SECRET"], scope: "user"
195
- omniauth_provider :apple, ENV["CLIENT_ID"], { scope: "email name", ... }
196
+ omniauth_provider :github, ENV["GITHUB_CLIENT_ID"], ENV["GITHUB_CLIENT_SECRET"], scope: "user"
197
+ omniauth_provider :apple, ENV["APPLE_CLIENT_ID"], ENV["APPLE_CLIENT_SECRET"], scope: "email name"
196
198
  end
197
199
 
198
200
  route do |r|
@@ -378,7 +380,7 @@ Content-Type: application/json
378
380
  { "error_type": "some_error", "error": "There was an error logging in with the external provider" }
379
381
  ```
380
382
 
381
- In this flow, you'll need to configure the callback URL on the OAuth app to point to the frontend app. On the OmniAuth strategy, you'll need to configure the same for GitHub requests, but keep the backend callback endpoint. For strategies based on [omniauth-oauth2], you can achieve this as follows:
383
+ In this flow, you'll need to configure the callback URL on the OAuth app to point to the frontend app. In the OmniAuth strategy, you'll need to configure the same redirect URL for OAuth requests, but keep the backend callback endpoint. For strategies based on [omniauth-oauth2], you can achieve this as follows:
382
384
 
383
385
  ```rb
384
386
  omniauth_provider :github, ENV["GITHUB_CLIENT_ID"], ENV["GITHUB_CLIENT_SECRET"],
@@ -203,7 +203,7 @@ module Rodauth
203
203
  end
204
204
 
205
205
  if defined?(Rodauth::Model)
206
- Rodauth::Model.register_association(:identities) do
206
+ Rodauth::Model.register_association(:omniauth) do
207
207
  { name: :identities, type: :many, table: omniauth_identities_table, key: omniauth_identities_id_column }
208
208
  end
209
209
  end
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "rodauth-omniauth"
3
- spec.version = "0.3.1"
3
+ spec.version = "0.3.2"
4
4
  spec.authors = ["Janko Marohnić"]
5
5
  spec.email = ["janko@hey.com"]
6
6
 
@@ -29,4 +29,5 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency "capybara"
30
30
  spec.add_development_dependency "jwt"
31
31
  spec.add_development_dependency "rodauth-i18n"
32
+ spec.add_development_dependency "rodauth-model"
32
33
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rodauth-omniauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.1
4
+ version: 0.3.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Janko Marohnić
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2022-12-14 00:00:00.000000000 Z
11
+ date: 2023-03-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rodauth
@@ -164,6 +164,20 @@ dependencies:
164
164
  - - ">="
165
165
  - !ruby/object:Gem::Version
166
166
  version: '0'
167
+ - !ruby/object:Gem::Dependency
168
+ name: rodauth-model
169
+ requirement: !ruby/object:Gem::Requirement
170
+ requirements:
171
+ - - ">="
172
+ - !ruby/object:Gem::Version
173
+ version: '0'
174
+ type: :development
175
+ prerelease: false
176
+ version_requirements: !ruby/object:Gem::Requirement
177
+ requirements:
178
+ - - ">="
179
+ - !ruby/object:Gem::Version
180
+ version: '0'
167
181
  description: Rodauth extension for logging in and creating account via OmniAuth authentication.
168
182
  email:
169
183
  - janko@hey.com
@@ -198,7 +212,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
198
212
  - !ruby/object:Gem::Version
199
213
  version: '0'
200
214
  requirements: []
201
- rubygems_version: 3.3.3
215
+ rubygems_version: 3.4.7
202
216
  signing_key:
203
217
  specification_version: 4
204
218
  summary: Rodauth extension for logging in and creating account via OmniAuth authentication.