gatleon-authform-rails 0.5.0 → 0.6.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +10 -3
- data/lib/gatleon/authform/rails/concern.rb +1 -1
- data/lib/gatleon/authform/rails/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f583501fb5e708d2e8e58b3410d38dfd1ff87f7224753657c95edc4737ccc4b4
|
4
|
+
data.tar.gz: 0f509e2572a8b9c2356f1b6c59e2c9f0dce1b2cb07fceb315b96937ee87c93cb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a26d09bed9e2f0f312e76984ce9779ea367e9c9a534db4dbedcebb02aba61ce31a206d494566fbb2dfd51af00a2e7e6c299ea030175911a0a63ca815b881faae
|
7
|
+
data.tar.gz: 4c03dfb1ed74fa7266c1dfc235aa728f0a53f3a3ec2b2547de4e8225566fe2bef9ede16386c14558634f729fb4a8841454775c030461a190527aa6631fcbd6b2
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -41,8 +41,8 @@ class ProfileController < ActionController::Base
|
|
41
41
|
def index
|
42
42
|
erb = <<~ERB
|
43
43
|
<h1>Profile</h1>
|
44
|
-
<p style="color: green;">You are signed in
|
45
|
-
<p><%= current_user %></p>
|
44
|
+
<p style="color: green;">You are signed in. (<a href="/profile/signoff">sign off</a>)</p>
|
45
|
+
<p><%= current_user._id %> <%= current_user._email %></p>
|
46
46
|
ERB
|
47
47
|
|
48
48
|
render inline: erb
|
@@ -52,7 +52,7 @@ class ProfileController < ActionController::Base
|
|
52
52
|
erb = <<~ERB
|
53
53
|
<p style="color: red;"><%= flash[:error] %></p>
|
54
54
|
<h1>Sign In</h1>
|
55
|
-
<form action="https://
|
55
|
+
<form action="https://authformapi.gatleon.com/v1/form/<%= Rails.application.credentials.dig(:authform, :public_key) %>" method="POST">
|
56
56
|
<input type="hidden" name="successPath" value="/profile">
|
57
57
|
<input type="email" name="email">
|
58
58
|
<button type="submit">Sign In</button>
|
@@ -62,6 +62,12 @@ class ProfileController < ActionController::Base
|
|
62
62
|
render inline: erb
|
63
63
|
end
|
64
64
|
|
65
|
+
def signoff
|
66
|
+
current_user.signoff!
|
67
|
+
|
68
|
+
redirect_to(profile_signin_path) and return
|
69
|
+
end
|
70
|
+
|
65
71
|
private
|
66
72
|
|
67
73
|
def require_login
|
@@ -80,6 +86,7 @@ add profile routes to routes.rb:
|
|
80
86
|
Rails.application.routes.draw do
|
81
87
|
get "/profile", to: "profile#index", as: :profile
|
82
88
|
get "/profile/signin", to: "profile#signin", as: :profile_signin
|
89
|
+
get "/profile/signoff", to: "profile#signoff", as: :profile_signoff
|
83
90
|
end
|
84
91
|
```
|
85
92
|
|
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.6.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-08-
|
11
|
+
date: 2020-08-18 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: xxhash
|