rodauth-omniauth 0.3.0 → 0.3.1

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: b983cad17d20d291428c75e8efd5d59b313e83ac68f7998d7d1ec6c508db0ac4
4
- data.tar.gz: e5db5f29f5d2897312d9dc4eca1cc34718ff56bd024bf2f79473a230a9e3cfbc
3
+ metadata.gz: bac8b21270ddf567a6ecaec293f34de53f683dfdc83d471ce0e0d422e8b60a71
4
+ data.tar.gz: aed02da319f49450d5e11358e94b40631a16dc466d26be07e9a049cf305f0d18
5
5
  SHA512:
6
- metadata.gz: d371d95667924f9e6ea1da68ab3e59471d794230de35eefa7d816edba211c734c981e1ef8ce724987cf58e0e10bf52773bad671dbb352dbbcd6b2762725bba1d
7
- data.tar.gz: 78feadd9466089523ec85e021c980fc90af051c92d6c981e04476888546524f4bcd010321bd89d0f5a4f788c68221ac87dfa6112ea97e67074c9c3ca532daadd
6
+ metadata.gz: e364a12a3d8d610cbe9192b2597374ee532c1b95179f6851a1461c9aaf6d975650ffc9aed989fef192e97f846d07cc8dca92f85833765963b865132b426cf5b6
7
+ data.tar.gz: '05490ea6ae366d7548ab3a02026c80c4d10ba0e5de5bc9adfba9a87db7b48f05d8732394c554be352330d21a1f78e2727b013e25c3cd3f91fa2d92702ca0ecc3'
data/README.md CHANGED
@@ -185,7 +185,7 @@ Account.first.identities #=>
185
185
 
186
186
  ## Base
187
187
 
188
- The `omniauth` feature builds on top of the `omniauth_base` feature, which sets up OmniAuth and routes its requests, but has no interaction with the database. So, if you would prefer to handle external logins differently, you can load just the `omniauth_base` feature, and implement your own callbacks.
188
+ The `omniauth` feature builds on top of the `omniauth_base` feature, which sets up OmniAuth and routes its requests, but has no interaction with the database. So, if you would prefer to handle external logins differently, you can load just the `omniauth_base` feature, and implement your own callback phase.
189
189
 
190
190
  ```rb
191
191
  plugin :rodauth do
@@ -355,7 +355,7 @@ Content-Type: application/json
355
355
  { "authorize_url": "https://github.com/login/oauth/authorize?..." }
356
356
  ```
357
357
 
358
- When you redirect the user to the authorize URL, and they authorize the OAuth app, the callback endpoint they're redirected to will contain query parameters that need to passed for the callback request to the backend.
358
+ When you redirect the user to the authorize URL, and they authorize the OAuth app, the callback endpoint they're redirected to will contain query parameters that need to be included in the callback request to the backend.
359
359
 
360
360
  ```http
361
361
  GET /auth/github/callback?code=...&state=...
@@ -369,13 +369,8 @@ Content-Type: application/json
369
369
  { "success": "You have been logged in" }
370
370
  ```
371
371
 
372
- If there was a login failure, the error type will be included in the response:
372
+ If there was an OmniAuth failure, the error type will be included in the response:
373
373
 
374
- ```http
375
- POST /auth/facebook/callback
376
- Accept: application/json
377
- Content-Type: application/json
378
- ```
379
374
  ```http
380
375
  500 Internal Server Error
381
376
  Content-Type: application/json
@@ -36,6 +36,8 @@ module Rodauth
36
36
  self.class.send(:define_method, :omniauth_app) { omniauth_app }
37
37
 
38
38
  self.class.roda_class.plugin :run_handler
39
+
40
+ i18n_register File.expand_path("#{__dir__}/../../../locales") if features.include?(:i18n)
39
41
  end
40
42
 
41
43
  def route!
data/locales/en.yml ADDED
@@ -0,0 +1,4 @@
1
+ en:
2
+ rodauth:
3
+ omniauth_failure_error_flash: There was an error logging in with the external provider
4
+ omniauth_login_unverified_account_error_flash: The account matching the external identity is currently awaiting verification
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |spec|
2
2
  spec.name = "rodauth-omniauth"
3
- spec.version = "0.3.0"
3
+ spec.version = "0.3.1"
4
4
  spec.authors = ["Janko Marohnić"]
5
5
  spec.email = ["janko@hey.com"]
6
6
 
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
  spec.metadata["homepage_uri"] = spec.homepage
15
15
  spec.metadata["source_code_uri"] = spec.homepage
16
16
 
17
- spec.files = Dir["README.md", "LICENSE.txt", "*.gemspec", "lib/**/*"]
17
+ spec.files = Dir["README.md", "LICENSE.txt", "*.gemspec", "lib/**/*", "locales/**/*"]
18
18
  spec.require_paths = ["lib"]
19
19
 
20
20
  spec.add_dependency "rodauth", "~> 2.13"
@@ -28,4 +28,5 @@ Gem::Specification.new do |spec|
28
28
  spec.add_development_dependency "net-smtp"
29
29
  spec.add_development_dependency "capybara"
30
30
  spec.add_development_dependency "jwt"
31
+ spec.add_development_dependency "rodauth-i18n"
31
32
  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.0
4
+ version: 0.3.1
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-05 00:00:00.000000000 Z
11
+ date: 2022-12-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rodauth
@@ -150,6 +150,20 @@ dependencies:
150
150
  - - ">="
151
151
  - !ruby/object:Gem::Version
152
152
  version: '0'
153
+ - !ruby/object:Gem::Dependency
154
+ name: rodauth-i18n
155
+ requirement: !ruby/object:Gem::Requirement
156
+ requirements:
157
+ - - ">="
158
+ - !ruby/object:Gem::Version
159
+ version: '0'
160
+ type: :development
161
+ prerelease: false
162
+ version_requirements: !ruby/object:Gem::Requirement
163
+ requirements:
164
+ - - ">="
165
+ - !ruby/object:Gem::Version
166
+ version: '0'
153
167
  description: Rodauth extension for logging in and creating account via OmniAuth authentication.
154
168
  email:
155
169
  - janko@hey.com
@@ -161,6 +175,7 @@ files:
161
175
  - README.md
162
176
  - lib/rodauth/features/omniauth.rb
163
177
  - lib/rodauth/features/omniauth_base.rb
178
+ - locales/en.yml
164
179
  - rodauth-omniauth.gemspec
165
180
  homepage: https://github.com/janko/rodauth-omniauth
166
181
  licenses: