lookup-y-oauth-js

    0.5.6 • Public • Published

    lookup-oauth-js

    Customized version of OAuth.io JavaScript SDK.

    Customization changes

    • custom server url (https://lookup-signin.herokuapp.com) in Grunfile.js envify section

    The last change is done in pretty clumsy way (will be appreciate for more elegant hint): in core.coffee getJquery is modified to return global jQuery variable - so it works in assumption, that global jQuery is available.

    If you are using RequireJS config can look like:

    {
        shim: {
            'jquery': {
                exports: 'jQuery'
            },
            'oauth-js': {
                deps: ['jquery'],
                exports: 'OAuth'
            }
        },
        paths: {
            'jquery': 'libs/jquery/dist/jquery',
            'oauth-js': 'libs/lookup-oauth-js/dist/oauth'
        }
    }

    ...and futher using like:

    define(['oauth-js'], function (OAuth) {
        OAuth.initialize(YOUR_OAUTHD_KEY);
        OAuth.popup(PROVIDER_NAME).done(function (result) {
            console.log('result: %o', result);
            result.me().done(function (data) {
                console.log('data: %o', data);
                alert('Hello ' + data.name + '!');
            }).fail(function (err) {
                console.log(err);
            });
        }).fail(function (err) {
            console.log(err);
        });
    });

    Versions

    2015-08-13: initital 0.4.3 version 2015-08-13: 0.4.4 version: removing Q dependency; dist file size decreased (uncompressed: 115 kB -> 52 kB)

    License

    This SDK is published under the Apache2 License.

    More information in oauth.io documentation

    Keywords

    none

    Install

    npm i lookup-y-oauth-js

    DownloadsWeekly Downloads

    1

    Version

    0.5.6

    License

    Apache-2.0

    Unpacked Size

    304 kB

    Total Files

    22

    Last publish

    Collaborators

    • avatar