gatleon-authform-rails 0.4.0 → 0.5.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: 04ed8f4e4e609113a7552950cad720ea3f662290239d8dbc0271c003c3d81e64
4
- data.tar.gz: 6a5cf946f350be87459a9e9c1912781914129305e431e55589f53c5ad17b8833
3
+ metadata.gz: 685b07de50135a4e5370690768aa9d3c35ee9ec6d69067cb64bf8d7114a17e15
4
+ data.tar.gz: 4575c9167863052ef09dbf8485d9ae61d3d31a3ab6e398f5ff13f877e5b7da92
5
5
  SHA512:
6
- metadata.gz: d9e0bbc47c53ccdad97b3e9a250d74453074be35234accada2d3ea01ac4da55814d83a7a6734fb09feef0a259c403f6d502a2ce6d4dbb528b2b83a1e6d2a1fc9
7
- data.tar.gz: 5446f0557ed77ca70d46d68d6751414c829653a922f2ec749a5b0552067f894fad4ef541e330e6b7d0ecd0f95e4cbbcb6bfb6d4ae10e7d3d4300aaf217dfd581
6
+ metadata.gz: 0faeb596324770954d58d7561a6269e2564e0c87bc46f5929a97a6af553787a6e2dfa04be77c7502ee9c3d8e13f02f46efcc92d6cc3af9114e846e0aa80a0318
7
+ data.tar.gz: d468569f24c293468138382d51d6eafa44d219307c2586daadd266a9dd22d3657651b2c6256635cb7f897e04b02ff5cfbfc338af43578f81fe091d1dfc8d2458
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gatleon-authform-rails (0.4.0)
4
+ gatleon-authform-rails (0.5.0)
5
5
  xxhash
6
6
 
7
7
  GEM
data/README.md CHANGED
@@ -1,6 +1,4 @@
1
- ![authform-rails](https://raw.githubusercontent.com/gatleon/gatleon-authform-rails/master/gatleon-authform-rails.png)
2
-
3
- # authform-rails by gatleon
1
+ # gatleon-authform-rails
4
2
 
5
3
  add authentication to your application - in 1 minute or less.
6
4
 
@@ -18,14 +16,25 @@ and then execute:
18
16
  $ bundle install
19
17
  ```
20
18
 
21
- add a profile controller
19
+ open rails credentials:
20
+
21
+ ```
22
+ $ EDITOR=vim rails credentials:edit
23
+ ```
24
+
25
+ set authform credentials:
26
+
27
+ ```
28
+ authform:
29
+ public_key: "Available at https://authform.gatleon.com"
30
+ secret_key: "Available at https://authform.gatleon.com"
31
+ ```
32
+
33
+ add a profile controller:
22
34
 
23
35
  ```ruby
24
36
  class ProfileController < ActionController::Base
25
- AUTHFORM_FORM_SECRET_KEY = "" # Available at https://authform.gatleon.com. coming soon!
26
- AUTHFORM_FORM_PUBLIC_KEY = "" # Available at https://authform.gatleon.com. coming soon!
27
-
28
- include Gatleon::Authform::Rails::Concern.new(public_key: AUTHFORM_FORM_PUBLIC_KEY, secret_key: AUTHFORM_FORM_SECRET_KEY)
37
+ include Gatleon::Authform::Rails::Concern.new(Rails.application.credentials.dig(:authform))
29
38
 
30
39
  before_action :require_login, only: [:index]
31
40
 
@@ -43,7 +52,8 @@ class ProfileController < ActionController::Base
43
52
  erb = <<~ERB
44
53
  <p style="color: red;"><%= flash[:error] %></p>
45
54
  <h1>Sign In</h1>
46
- <form action="https://authform.gatleon.com/v1/form/<%= ProfileController::AUTHFORM_FORM_PUBLIC_KEY %>" method="POST">
55
+ <form action="https://api.authform.io/v1/form/<%= Rails.application.credentials.dig(:authform, :public_key) %>" method="POST">
56
+ <input type="hidden" name="successPath" value="/profile">
47
57
  <input type="email" name="email">
48
58
  <button type="submit">Sign In</button>
49
59
  </form>
@@ -64,12 +74,12 @@ class ProfileController < ActionController::Base
64
74
  end
65
75
  ```
66
76
 
67
- add profile routes to routes.rb
77
+ add profile routes to routes.rb:
68
78
 
69
79
  ```ruby
70
80
  Rails.application.routes.draw do
71
- get '/profile', to: 'profile#index', as: 'profile'
72
- get '/profile/signin', to: 'profile#signin', as: 'profile_signin'
81
+ get "/profile", to: "profile#index", as: :profile
82
+ get "/profile/signin", to: "profile#signin", as: :profile_signin
73
83
  end
74
84
  ```
75
85
 
@@ -8,7 +8,7 @@ module Gatleon
8
8
  secret_key:,
9
9
  domain: nil,
10
10
  current_user_method_name: "current_user",
11
- _authform_base_url: "https://authform.gatleon.com")
11
+ _authform_base_url: "https://api.authform.io")
12
12
  super() do
13
13
  extend ActiveSupport::Concern
14
14
 
@@ -1,7 +1,7 @@
1
1
  module Gatleon
2
2
  module Authform
3
3
  module Rails
4
- VERSION = "0.4.0"
4
+ VERSION = "0.5.0"
5
5
  end
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: gatleon-authform-rails
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.5.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - gatleon
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2020-05-03 00:00:00.000000000 Z
11
+ date: 2020-08-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xxhash
@@ -43,7 +43,6 @@ files:
43
43
  - bin/console
44
44
  - bin/setup
45
45
  - gatleon-authform-rails.gemspec
46
- - gatleon-authform-rails.png
47
46
  - lib/gatleon/authform/rails.rb
48
47
  - lib/gatleon/authform/rails/concern.rb
49
48
  - lib/gatleon/authform/rails/user.rb
Binary file