You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-10Lines changed: 18 additions & 10 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,8 +1,8 @@
1
1
# Tokenable
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/tokenable`. To experiment with that code, run `bin/console` for an interactive prompt.
3
+
Tokenable is a gem for Rails to enable the ability for API applications to provide Authentication.
4
4
5
-
TODO: Delete this and the text above, and describe your gem
5
+
This allows you to provide authentication to mobile apps, or SPAs with ease.
6
6
7
7
## Installation
8
8
@@ -14,21 +14,19 @@ gem 'tokenable'
14
14
15
15
And then execute:
16
16
17
-
bundle install
18
-
19
-
Or install it yourself as:
20
-
21
-
gem install tokenable
17
+
```
18
+
bundle install
19
+
```
22
20
23
21
## Usage
24
22
25
-
In your `routes.rb`, please add:
23
+
In your `config/routes.rb`, please add:
26
24
27
25
```ruby
28
26
mount Tokenable::Engine => '/api/auth'
29
27
```
30
28
31
-
And in your `User` model, please add an Auth strategy, such as:
29
+
And in your `User` model, please add an Auth Strategy. For example, if you are using `has_secure_password`, then you could use:
32
30
33
31
```ruby
34
32
classUser < ApplicationRecord
@@ -43,7 +41,17 @@ You can chose from:
43
41
-`Tokenable::Strategies::SecurePassword`
44
42
-`Tokenable::Strategies::Devise`
45
43
46
-
You can also create your own stragery. (TODO: link to docs on this)
44
+
You can also create your own stragery. This is as simple as creating a method on the User object.
0 commit comments