authform-rails 0.2.0 → 0.2.1
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/{LICENSE.txt → LICENSE.md} +1 -1
- data/README.md +31 -15
- data/lib/authform/rails/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6462259228c2158788d23a2e51801ba38daa7de0be0bbfe120ff0b6aa7747bcf
|
4
|
+
data.tar.gz: a0fc634b1451aeb1afaeea9076bbccf7263447341e07af52326629b2c490fd4c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 64bb19fcfb3edb0c55c4c09b9e5844d53a6baec370523ca77fc47f0425d8dcb63f0442b15ece83e4c98c6c5d8d91e09a8a82ad48fbea12d4e25076bf1e43a1c0
|
7
|
+
data.tar.gz: 61520120617645201a4006f35cbba9b7eeed0afa591e817bc6308c2b56f80f7a91bb147d3755fc3251fa96f6be8d502ee9f7d145343e9c1186b0192bfdf5204b
|
data/Gemfile.lock
CHANGED
data/{LICENSE.txt → LICENSE.md}
RENAMED
data/README.md
CHANGED
@@ -1,39 +1,55 @@
|
|
1
|
-
# Authform
|
1
|
+
# Authform Rails
|
2
2
|
|
3
|
-
|
3
|
+
## Introduction
|
4
4
|
|
5
|
-
|
5
|
+
Add authentication to your Rails application - in 1 minute or less - with <a href="https://api.authform.io">Authform.io</a>.
|
6
6
|
|
7
7
|
## Installation
|
8
8
|
|
9
|
-
Add this line to your application's Gemfile:
|
9
|
+
Add this line to your Rails application's Gemfile:
|
10
10
|
|
11
11
|
```ruby
|
12
|
-
gem
|
12
|
+
gem "authform-rails"
|
13
13
|
```
|
14
14
|
|
15
15
|
And then execute:
|
16
16
|
|
17
|
-
|
17
|
+
```bash
|
18
|
+
$ bundle install
|
19
|
+
```
|
18
20
|
|
19
|
-
|
21
|
+
## Usage
|
20
22
|
|
21
|
-
|
23
|
+
Add your form
|
22
24
|
|
23
|
-
|
25
|
+
```html
|
26
|
+
<form action="https://api.authform.io/v1/f/{FORM_UUID}" method="POST">
|
27
|
+
<input type="email" name="email">
|
28
|
+
<button type="submit">Sign In</button>
|
29
|
+
</form>
|
30
|
+
```
|
24
31
|
|
25
|
-
|
32
|
+
Add the Authform::Rails::Concern to your ApplicationController.rb
|
26
33
|
|
27
|
-
|
34
|
+
```ruby
|
35
|
+
class ApplicationController < ActionController::Base
|
36
|
+
include Authform::Rails::Concern.new form_uuid: {FORM_UUID}
|
28
37
|
|
29
|
-
|
38
|
+
before_action :require_login
|
30
39
|
|
31
|
-
|
40
|
+
private
|
32
41
|
|
33
|
-
|
42
|
+
def require_login
|
43
|
+
unless current_user
|
44
|
+
flash[:error] = "You must be logged in to access this section"
|
34
45
|
|
35
|
-
|
46
|
+
redirect_to new_login_url # halts request cycle
|
47
|
+
end
|
48
|
+
end
|
49
|
+
end
|
50
|
+
```
|
36
51
|
|
52
|
+
That's it!
|
37
53
|
|
38
54
|
## License
|
39
55
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: authform-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- gatleon
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-02-
|
11
|
+
date: 2020-02-05 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: faraday
|
@@ -36,7 +36,7 @@ files:
|
|
36
36
|
- ".travis.yml"
|
37
37
|
- Gemfile
|
38
38
|
- Gemfile.lock
|
39
|
-
- LICENSE.
|
39
|
+
- LICENSE.md
|
40
40
|
- README.md
|
41
41
|
- Rakefile
|
42
42
|
- authform-rails.gemspec
|