authform-rails 0.2.0 → 0.2.1

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: 7b38c9d775b5e9861d131ce83c0525ea036c1650b89c7fab83cfb7b294e7e349
4
- data.tar.gz: 857853905a28f5bd2270d8df9ae2ec862f105f17774ac37ea39cc895f507bfca
3
+ metadata.gz: 6462259228c2158788d23a2e51801ba38daa7de0be0bbfe120ff0b6aa7747bcf
4
+ data.tar.gz: a0fc634b1451aeb1afaeea9076bbccf7263447341e07af52326629b2c490fd4c
5
5
  SHA512:
6
- metadata.gz: 6a28bf0004e36d4f765d022dbbf8244092cbb180f70fb36ac2c528fcdb332ff013777009b1c528539b8e7fe30434bfce72a43af91a2f305d1fbdf72c72823329
7
- data.tar.gz: 46c3ce5bf584903a592fe69ef8150ab740426a4b8463188b7466023015bb767e9711671009e2c5f20c1af6c4dd378a0fca07b6035f334818131a299fee7669b1
6
+ metadata.gz: 64bb19fcfb3edb0c55c4c09b9e5844d53a6baec370523ca77fc47f0425d8dcb63f0442b15ece83e4c98c6c5d8d91e09a8a82ad48fbea12d4e25076bf1e43a1c0
7
+ data.tar.gz: 61520120617645201a4006f35cbba9b7eeed0afa591e817bc6308c2b56f80f7a91bb147d3755fc3251fa96f6be8d502ee9f7d145343e9c1186b0192bfdf5204b
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- authform-rails (0.2.0)
4
+ authform-rails (0.2.1)
5
5
  faraday
6
6
 
7
7
  GEM
@@ -1,6 +1,6 @@
1
1
  The MIT License (MIT)
2
2
 
3
- Copyright (c) 2020 motdotla
3
+ Copyright (c) 2020 NM Digital LLC
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
data/README.md CHANGED
@@ -1,39 +1,55 @@
1
- # Authform::Rails
1
+ # Authform Rails
2
2
 
3
- Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/authform/rails`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+ ## Introduction
4
4
 
5
- TODO: Delete this and the text above, and describe your gem
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 'authform-rails'
12
+ gem "authform-rails"
13
13
  ```
14
14
 
15
15
  And then execute:
16
16
 
17
- $ bundle install
17
+ ```bash
18
+ $ bundle install
19
+ ```
18
20
 
19
- Or install it yourself as:
21
+ ## Usage
20
22
 
21
- $ gem install authform-rails
23
+ Add your form
22
24
 
23
- ## Usage
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
- TODO: Write usage instructions here
32
+ Add the Authform::Rails::Concern to your ApplicationController.rb
26
33
 
27
- ## Development
34
+ ```ruby
35
+ class ApplicationController < ActionController::Base
36
+ include Authform::Rails::Concern.new form_uuid: {FORM_UUID}
28
37
 
29
- After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
38
+ before_action :require_login
30
39
 
31
- To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
40
+ private
32
41
 
33
- ## Contributing
42
+ def require_login
43
+ unless current_user
44
+ flash[:error] = "You must be logged in to access this section"
34
45
 
35
- Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/authform-rails.
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
 
@@ -1,5 +1,5 @@
1
1
  module Authform
2
2
  module Rails
3
- VERSION = "0.2.0"
3
+ VERSION = "0.2.1"
4
4
  end
5
5
  end
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.0
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-04 00:00:00.000000000 Z
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.txt
39
+ - LICENSE.md
40
40
  - README.md
41
41
  - Rakefile
42
42
  - authform-rails.gemspec