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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +22 -12
- data/lib/gatleon/authform/rails/concern.rb +1 -1
- data/lib/gatleon/authform/rails/version.rb +1 -1
- metadata +2 -3
- data/gatleon-authform-rails.png +0 -0
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 685b07de50135a4e5370690768aa9d3c35ee9ec6d69067cb64bf8d7114a17e15
|
|
4
|
+
data.tar.gz: 4575c9167863052ef09dbf8485d9ae61d3d31a3ab6e398f5ff13f877e5b7da92
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 0faeb596324770954d58d7561a6269e2564e0c87bc46f5929a97a6af553787a6e2dfa04be77c7502ee9c3d8e13f02f46efcc92d6cc3af9114e846e0aa80a0318
|
|
7
|
+
data.tar.gz: d468569f24c293468138382d51d6eafa44d219307c2586daadd266a9dd22d3657651b2c6256635cb7f897e04b02ff5cfbfc338af43578f81fe091d1dfc8d2458
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
|
@@ -1,6 +1,4 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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.
|
|
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
|
|
72
|
-
get
|
|
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
|
|
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
|
+
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-
|
|
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
|
data/gatleon-authform-rails.png
DELETED
|
Binary file
|