Skip to content

Commit e351407

Browse files
authored
Update README to support axios library
1 parent 22cc889 commit e351407

File tree

1 file changed

+15
-10
lines changed

1 file changed

+15
-10
lines changed

README.md

Lines changed: 15 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[**WARNING**]: README file is currently in process of rewrite and will be released soon.
2+
13
# vue-authenticate
24

35
[![Join the chat at https://gitter.im/vuejs-auth/vue-authenticate](https://badges.gitter.im/vue-authenticate/Lobby.svg)](https://gitter.im/vuejs-auth/vue-authenticate?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
@@ -10,7 +12,7 @@ The best part about this library is that it is not strictly coupled to one reque
1012

1113
For now it is tested to work with [vue-resource](https://github.com/pagekit/vue-resource) and [axios](https://github.com/mzabriskie/axios) (using [vue-axios](https://github.com/imcvampire/vue-axios) wrapper).
1214

13-
**WARNING** From version 1.3.0 default request library is `axios` using `vue-axios` wrapper plugin.
15+
**WARNING:** From version 1.3.0 default request library is `axios` using `vue-axios` wrapper plugin.
1416

1517
This library was inspired by well known authentication library for Angular called [Satellizer](https://github.com/sahat/satellizer) developed by [Sahat Yalkabov](http://sahatyalkabov.com). They share almost identical configuration and API so you can easily switch from Angular to Vue.js project.
1618

@@ -33,10 +35,11 @@ npm install vue-authenticate
3335
## Usage
3436
```javascript
3537
import Vue from 'vue'
36-
import VueResource from 'vue-resource'
38+
import VueAxios from 'vue-axios'
3739
import VueAuthenticate from 'vue-authenticate'
40+
import axios from 'axios';
3841

39-
Vue.use(VueResource)
42+
Vue.use(VueAxios, axios)
4043
Vue.use(VueAuthenticate, {
4144
baseUrl: 'http://localhost:3000', // Your API domain
4245

@@ -73,7 +76,7 @@ new Vue({
7376
<button @click="register()">Register</button>
7477
```
7578

76-
### Social authentication
79+
### Social account authentication
7780

7881
```javascript
7982
new Vue({
@@ -102,13 +105,14 @@ new Vue({
102105
// ES6 example
103106
import Vue from 'vue'
104107
import Vuex from 'vuex'
105-
import VueResource from 'vue-resource'
108+
import VueAxios from 'vue-axios'
106109
import { VueAuthenticate } from 'vue-authenticate'
110+
import axios from 'axios';
107111

108112
Vue.use(Vuex)
109-
Vue.use(VueResource)
113+
Vue.use(VueAxios, axios)
110114

111-
const vueAuth = new VueAuthenticate(Vue.http, {
115+
const vueAuth = new VueAuthenticate(Vue.prototype.$http, {
112116
baseUrl: 'http://localhost:4000'
113117
})
114118
```
@@ -117,14 +121,15 @@ const vueAuth = new VueAuthenticate(Vue.http, {
117121
// CommonJS example
118122
var Vue = require('vue')
119123
var Vuex = require('vuex')
120-
var VueResource = require('vue-resource')
124+
var VueAxios = require('vue-axios')
121125
var VueAuthenticate = require('vue-authenticate')
126+
var axios = require('axios');
122127

123128
Vue.use(Vuex)
124-
Vue.use(VueResource)
129+
Vue.use(VueAxios, axios)
125130

126131
// ES5, CommonJS example
127-
var vueAuth = VueAuthenticate.factory(Vue.http, {
132+
var vueAuth = VueAuthenticate.factory(Vue.prototype.$http, {
128133
baseUrl: 'http://localhost:4000'
129134
})
130135
```

0 commit comments

Comments
 (0)