1.6.1 • Published 3 years ago

donny-auth v1.6.1

Weekly downloads
327
License
UNLICENSED
Repository
-
Last release
3 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

3 years ago

1.6.0

3 years ago

1.5.7

4 years ago

1.5.6

7 years ago

1.5.5

7 years ago

1.5.4

7 years ago

1.5.2

7 years ago

1.5.1

7 years ago

1.5.0

7 years ago

1.4.0

7 years ago

1.3.0

7 years ago

1.2.0

7 years ago

1.1.3

7 years ago

1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago