1.6.1 • Published 2 years ago

donny-auth v1.6.1

Weekly downloads
327
License
UNLICENSED
Repository
-
Last release
2 years ago

donny-auth

A client library for authenticating with the donny-auth system

install

yarn add donny-auth

usage

const TokenStore = require('donny-auth')

// the source needs to be an html page
const store = new TokenStore('https://auth-store')

store.getToken({
    aud: 'audience'
}).then(function (token) {
    if (!token) {
        // redirect to `store.loginUrl`
    }
    // do stuff with token
}, function (err) {
    // probably means you're not allowed to use donny-auth on this domain
})

// if you have an API2 token
store.upgradeToken({
    aud: 'audience',
    api2_token: 'your-api2-token'
}).then(function (token) {
    if (!token) {
        // redirect to `store.loginUrl`
    }
    // do stuff with token
}, function (err) {
    // probably means you're not allowed to use donny-auth on this domain
})
1.6.1

2 years ago

1.6.0

2 years ago

1.5.7

3 years ago

1.5.6

6 years ago

1.5.5

6 years ago

1.5.4

6 years ago

1.5.2

6 years ago

1.5.1

6 years ago

1.5.0

6 years ago

1.4.0

6 years ago

1.3.0

6 years ago

1.2.0

6 years ago

1.1.3

6 years ago

1.1.2

6 years ago

1.1.1

6 years ago

1.1.0

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago