1.0.24 • Published 6 years ago

devise-axios v1.0.24

Weekly downloads
65
License
MIT
Repository
github
Last release
6 years ago

About

This package fits a very specific use case. Its purpose is to help keep track of new tokens everytime a request is made. It works by capturing the axios response and hot swapping tokens if new tokens have come back from the server. On an authenticated request, tokens are destroyed on signout and tokens are rehydrated on a validation event.

  • You are using devise token authentication
  • You are using axios

Installation

npm install devise-axios

import { initMiddleware } from 'devise-axios'

initMiddleware()

You can also change the default auth url and options

  //defaults
  //{
  //  authPrefix: '/api/auth',
  //  signOut: '/sign_out',
  //  validate: '/validate_token',
  //}

  const options = { authPrefix: '/auth' }
  initMiddleware(options)

This works with ReactNative as well. (What?)

import { AsyncStorage } from 'react-native'
import initMiddleware from 'devise-axios'

initMiddleware({ storage: AsyncStorage })
1.0.24

6 years ago

1.0.23

6 years ago

1.0.22

6 years ago

1.0.21

6 years ago

1.0.20

6 years ago

1.0.19

6 years ago

1.0.18

6 years ago

1.0.17

6 years ago

1.0.16

6 years ago

1.0.15

6 years ago

1.0.14

6 years ago

1.0.13

6 years ago

1.0.12

6 years ago

1.0.11

6 years ago

1.0.10

6 years ago

1.0.9

6 years ago

1.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago

0.0.2

6 years ago

0.0.1

6 years ago