Skip to content

Commit 3eaa1d9

Browse files
Linking to examples, instead of showing them inline
1 parent b5a9230 commit 3eaa1d9

File tree

1 file changed

+7
-20
lines changed

1 file changed

+7
-20
lines changed

README.md

Lines changed: 7 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -84,31 +84,18 @@ Tokenable::Config.lifespan = 7.days
8484
Tokenable::Config.lifespan = nil
8585
```
8686

87-
### Example Usage
87+
### Example Use Cases
8888

89-
Once you have this setup, you can login. For example, you could login using `axios` in JavaScript:
89+
Once you have this setup, you will then be able to integrate your Rails API with a mobile app, single page application, or any other type of system. Here are some example use cases:
9090

91-
```js
92-
const { data } = await axios.post("https://example.com/api/auth", {
93-
94-
password: "coolpassword123",
95-
});
96-
97-
const token = data.data.token;
98-
const user_id = data.data.user_id;
99-
```
100-
101-
You then use this token in all future API requests:
102-
103-
```js
104-
const { data } = await axios.get(`https://example.com/api/user/${user_id}`, {
105-
headers: { Authorization: `Bearer ${token}` },
106-
});
107-
```
91+
- [Using Tokenable with Nuxt.js Auth](https://github.com/tokenable/tokenable-ruby/wiki/Integration-with-Nuxt.js-Auth)
92+
- [Using Tokenable with Axios](https://github.com/tokenable/tokenable-ruby/wiki/Integration-with-Axios)
10893

10994
## Development
11095

111-
After checking out the repo, run `bin/setup` to install dependencies. Then, run `bundle exec rspec` to run the tests.
96+
After checking out the repo, run `bin/setup` to install dependencies.
97+
98+
Then, run `bundle exec rspec` to run the tests.
11299

113100
## Contributing
114101

0 commit comments

Comments
 (0)