gatleon-authform-rails 0.5.0 → 0.6.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: 685b07de50135a4e5370690768aa9d3c35ee9ec6d69067cb64bf8d7114a17e15
4
- data.tar.gz: 4575c9167863052ef09dbf8485d9ae61d3d31a3ab6e398f5ff13f877e5b7da92
3
+ metadata.gz: f583501fb5e708d2e8e58b3410d38dfd1ff87f7224753657c95edc4737ccc4b4
4
+ data.tar.gz: 0f509e2572a8b9c2356f1b6c59e2c9f0dce1b2cb07fceb315b96937ee87c93cb
5
5
  SHA512:
6
- metadata.gz: 0faeb596324770954d58d7561a6269e2564e0c87bc46f5929a97a6af553787a6e2dfa04be77c7502ee9c3d8e13f02f46efcc92d6cc3af9114e846e0aa80a0318
7
- data.tar.gz: d468569f24c293468138382d51d6eafa44d219307c2586daadd266a9dd22d3657651b2c6256635cb7f897e04b02ff5cfbfc338af43578f81fe091d1dfc8d2458
6
+ metadata.gz: a26d09bed9e2f0f312e76984ce9779ea367e9c9a534db4dbedcebb02aba61ce31a206d494566fbb2dfd51af00a2e7e6c299ea030175911a0a63ca815b881faae
7
+ data.tar.gz: 4c03dfb1ed74fa7266c1dfc235aa728f0a53f3a3ec2b2547de4e8225566fe2bef9ede16386c14558634f729fb4a8841454775c030461a190527aa6631fcbd6b2
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- gatleon-authform-rails (0.5.0)
4
+ gatleon-authform-rails (0.6.0)
5
5
  xxhash
6
6
 
7
7
  GEM
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.</p>
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://api.authform.io/v1/form/<%= Rails.application.credentials.dig(:authform, :public_key) %>" method="POST">
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
 
@@ -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://api.authform.io")
11
+ _authform_base_url: "https://authformapi.gatleon.com")
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.5.0"
4
+ VERSION = "0.6.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.5.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-17 00:00:00.000000000 Z
11
+ date: 2020-08-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xxhash